Skip to content

[WIP] Setup angular template for embark #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added app/app/app.component.css
Empty file.
1 change: 1 addition & 0 deletions app/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Embark Application</h1>
9 changes: 9 additions & 0 deletions app/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Component } from '@angular/core';


@Component({
selector: 'embark-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent { }
15 changes: 15 additions & 0 deletions app/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';

@NgModule({
imports: [
BrowserModule
],
declarations: [
AppComponent
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
3 changes: 3 additions & 0 deletions app/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: true
}
3 changes: 3 additions & 0 deletions app/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: false
}
11 changes: 6 additions & 5 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<base href="/">
<title>Embark</title>
<link rel="stylesheet" href="css/app.css">
<script src="js/app.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h3>Welcome to Embark!</h3>
<p>See the <a href="http://embark.readthedocs.io/en/latest/index.html" target="_blank">Embark's documentation</a> to see what you can do with Embark!</p>
<embark-app>Loading...</embark-app>
</body>
</html>
</html>
10 changes: 10 additions & 0 deletions app/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we have some wrong indentation here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not sure I follow.. but maybe I wasn't clear enough. I wanted to point out that there's some wrong formatting, the } being indented, which probably shouldn't be.


platformBrowserDynamic().bootstrapModule(AppModule);
4 changes: 4 additions & 0 deletions app/polyfills.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import 'core-js/es6';
import 'core-js/es7/reflect';

require('zone.js/dist/zone');
Empty file added app/style.css
Empty file.
3 changes: 3 additions & 0 deletions app/vendor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this file isn't needed. It doesn't seem to be imported anywhere. Can you verify this @iamonuwa ?

1 change: 1 addition & 0 deletions chains.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
4 changes: 2 additions & 2 deletions embark.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"contracts": ["contracts/**"],
"app": {
"css/app.css": ["app/css/**"],
"js/app.js": ["app/js/index.ts"],
"css/app.css": ["app/style.css"],
"js/app.js": ["app/main.ts"],
"images/": ["app/images/**"],
"index.html": "app/index.html"
},
Expand Down
Loading