-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SystemJs builder
- Loading branch information
Vlado Tesanovic
authored and
Vlado Tesanovic
committed
May 22, 2016
1 parent
4c58282
commit f8aca6a
Showing
19 changed files
with
127 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules | ||
app/**/*.js | ||
app/**/*.js.map | ||
typings | ||
npm-debug.log | ||
public/ng2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
h1 { | ||
color: white; | ||
background: darkred; | ||
background: darkgray; | ||
padding: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
<h1>My First {{name}} app</h1> | ||
<h1>My First {{name}} app</h1> | ||
|
||
<pre>Response from server: /users</pre> | ||
<pre>{{ ( users | async)?.name }}</pre> | ||
<pre>{{ ( users | async)?.last }}</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
import {Component} from '@angular/core'; | ||
import { ApplicationConstants } from '../constants/ApplicationConstants'; | ||
import { Component } from '@angular/core'; | ||
import { Http } from "@angular/http"; | ||
import 'rxjs/add/operator/map'; | ||
|
||
@Component({ | ||
selector: 'my-app', | ||
templateUrl: ApplicationConstants.BASE_TEMPLATE_PATH + 'components/app.component.html', | ||
styleUrls: [ApplicationConstants.BASE_TEMPLATE_PATH + 'components/app.component.css'] | ||
templateUrl: 'components/app.component.html', | ||
styleUrls: ['components/app.component.css'] | ||
}) | ||
export class AppComponent { | ||
name: string = "Angular 2 on Express"; | ||
users: {}; | ||
|
||
constructor(http: Http) { | ||
this.users = http.get("/users").map(data => data.json()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export class ApplicationConstants { | ||
|
||
public static get BASE_TEMPLATE_PATH(): string { return 'ng2/'; } | ||
|
||
public static get BASE_TEMPLATE_PATH(): string { | ||
return 'ng2/'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
import {bootstrap} from '@angular/platform-browser-dynamic'; | ||
import {AppComponent} from './components/app.component' | ||
import { bootstrap } from '@angular/platform-browser-dynamic'; | ||
import { AppComponent } from './components/app.component' | ||
import { Type } from '@angular/core'; | ||
import { HTTP_PROVIDERS } from "@angular/http"; | ||
|
||
bootstrap(AppComponent); | ||
bootstrap(<Type>AppComponent, [ | ||
HTTP_PROVIDERS | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var SystemBuilder = require('systemjs-builder'); | ||
var argv = require('yargs').argv; | ||
var builder = new SystemBuilder(); | ||
|
||
builder.loadConfig('./public/js/systemjs.config.js') | ||
.then(function(){ | ||
var outputFile = argv.prod ? './public/js/bundle.min.js' : './public/js/bundle.js'; | ||
return builder.buildStatic('app', outputFile, { | ||
minify: argv.prod, | ||
mangle: argv.prod, | ||
rollup: argv.prod | ||
}); | ||
}) | ||
.then(function() { | ||
console.log('bundle built successfully!'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@import url(https://fonts.googleapis.com/css?family=Source+Code+Pro); | ||
|
||
body { | ||
padding: 50px; | ||
font-family: 'Source Code Pro', serif; | ||
} | ||
|
||
a { | ||
color: #00B7FF; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"ambientDependencies": { | ||
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c", | ||
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#d594ef506d1efe2fea15f8f39099d19b39436b71" | ||
"core-js": "registry:dt/core-js#0.0.0+20160317120654", | ||
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438", | ||
"node": "registry:dt/node#4.0.0+20160509154515" | ||
} | ||
} | ||
} |