Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to angular@^2.0.0. Close #27
- Loading branch information
1 parent
3a5eaa0
commit bf13b87
Showing
17 changed files
with
189 additions
and
134 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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {Component} from "@angular/core"; | ||
import {Http} from "@angular/http"; | ||
|
||
|
||
@Component({ | ||
selector: 'app', | ||
templateUrl: 'src/AppComponent.html' | ||
}) | ||
export class AppComponent { | ||
|
||
public data; | ||
|
||
constructor(private http:Http) { | ||
http.get("/src/data.json") | ||
.subscribe((data)=> { | ||
setTimeout(()=> { | ||
this.data = data.json(); | ||
}, 2000); | ||
}); | ||
} | ||
|
||
public toInt(num:string) { | ||
return +num; | ||
} | ||
|
||
public sortByWordLength = (a:any) => { | ||
return a.name.length; | ||
} | ||
|
||
} |
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,18 @@ | ||
import {NgModule} from "@angular/core"; | ||
import {AppComponent} from "./AppComponent"; | ||
import {BrowserModule} from "@angular/platform-browser"; | ||
import {DataTableModule} from "angular2-datatable"; | ||
import {HttpModule} from "@angular/http"; | ||
|
||
@NgModule({ | ||
imports: [ | ||
BrowserModule, | ||
DataTableModule, | ||
HttpModule | ||
], | ||
declarations: [AppComponent], | ||
bootstrap: [AppComponent] | ||
}) | ||
export class AppModule { | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import {bootstrap} from '@angular/platform-browser-dynamic'; | ||
import {platformBrowserDynamic} from "@angular/platform-browser-dynamic"; | ||
import {AppModule} from "./AppModule"; | ||
|
||
import { App } from './app'; | ||
|
||
bootstrap(App); | ||
const platform = platformBrowserDynamic(); | ||
platform.bootstrapModule(AppModule); |
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,48 +1,48 @@ | ||
(function(global) { | ||
|
||
// map tells the System loader where to look for things | ||
var map = { | ||
'src': 'build', // 'dist', | ||
'rxjs': 'node_modules/rxjs', | ||
'@angular': 'node_modules/@angular', | ||
'angular2-datatable': 'node_modules/angular2-datatable', | ||
'lodash': 'node_modules/lodash/lodash.js', | ||
}; | ||
|
||
// packages tells the System loader how to load when no filename and/or no extension | ||
var packages = { | ||
'src': { main: 'main.js', defaultExtension: 'js' }, | ||
'rxjs': { defaultExtension: 'js' }, | ||
'angular2-datatable': { defaultExtension: 'js' }, | ||
'lodash': { defaultExtension: 'js' }, | ||
}; | ||
|
||
var packageNames = [ | ||
'@angular/common', | ||
'@angular/compiler', | ||
'@angular/core', | ||
'@angular/http', | ||
'@angular/platform-browser', | ||
'@angular/platform-browser-dynamic', | ||
// '@angular/router', | ||
// '@angular/router-deprecated', | ||
// '@angular/testing', | ||
// '@angular/upgrade', | ||
]; | ||
|
||
// add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' } | ||
packageNames.forEach(function(pkgName) { | ||
packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }; | ||
/** | ||
* System configuration for Angular samples | ||
* Adjust as necessary for your application needs. | ||
*/ | ||
(function (global) { | ||
System.config({ | ||
paths: { | ||
// paths serve as alias | ||
'npm:': 'node_modules/' | ||
}, | ||
// map tells the System loader where to look for things | ||
map: { | ||
// our app is within the app folder | ||
src: 'build', | ||
// angular bundles | ||
'@angular/core': 'npm:@angular/core/bundles/core.umd.js', | ||
'@angular/common': 'npm:@angular/common/bundles/common.umd.js', | ||
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', | ||
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', | ||
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', | ||
'@angular/http': 'npm:@angular/http/bundles/http.umd.js', | ||
'@angular/router': 'npm:@angular/router/bundles/router.umd.js', | ||
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', | ||
// other libraries | ||
'rxjs': 'npm:rxjs', | ||
'angular2-datatable': 'npm:angular2-datatable', | ||
'lodash': 'npm:lodash' | ||
}, | ||
// packages tells the System loader how to load when no filename and/or no extension | ||
packages: { | ||
src: { | ||
main: './main.js', | ||
defaultExtension: 'js' | ||
}, | ||
rxjs: { | ||
defaultExtension: 'js' | ||
}, | ||
'angular2-datatable': { | ||
main: 'index.js', | ||
defaultExtension: 'js' | ||
}, | ||
lodash: { | ||
main: 'lodash.js', | ||
defaultExtension: 'js' | ||
} | ||
} | ||
}); | ||
|
||
var config = { | ||
map: map, | ||
packages: packages | ||
}; | ||
|
||
// filterSystemConfig - index.html's chance to modify config before we register it. | ||
if (global.filterSystemConfig) { global.filterSystemConfig(config); } | ||
|
||
System.config(config); | ||
|
||
})(this); |
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
Oops, something went wrong.