Skip to content

Commit 6cba043

Browse files
author
Eric Anderson
committed
Finish upgrade to Angular 2 RC 1
1 parent 228731b commit 6cba043

17 files changed

+141
-29094
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,6 @@ _Pvt_Extensions
234234

235235
# FAKE - F# Make
236236
.fake/
237+
238+
# wwwRoot Angualr 2 libs
239+
wwwroot/Angular/lib/

src/ASP.NET-Core-SPAs/Angular/app.component.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ASP.NET-Core-SPAs/Angular/app.component.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ASP.NET-Core-SPAs/Angular/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'rxjs/Rx';
1111
template: `
1212
<h1>{{title}}</h1>
1313
<ul class="contacts">
14-
<li *ngFor="#contact of contacts"
14+
<li *ngFor="let contact of contacts"
1515
[class.selected]="contact === selectedContact"
1616
(click)="onSelect(contact)">
1717
<span class="badge">{{contact.Id}}</span> {{contact.Name}}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
(function (global) {
2+
3+
// map tells the System loader where to look for things
4+
var map = {
5+
'app': '../Angular/app',
6+
'rxjs': '../Angular/lib/rxjs',
7+
'@angular': '../Angular/lib/@angular'
8+
};
9+
10+
// packages tells the System loader how to load when no filename and/or no extension
11+
var packages = {
12+
'app': { main: 'boot.js', defaultExtension: 'js' },
13+
'rxjs': { defaultExtension: 'js' }
14+
};
15+
16+
var packageNames = [
17+
'@angular/common',
18+
'@angular/compiler',
19+
'@angular/core',
20+
'@angular/http',
21+
'@angular/platform-browser',
22+
'@angular/platform-browser-dynamic',
23+
'@angular/router',
24+
'@angular/router-deprecated',
25+
'@angular/testing',
26+
'@angular/upgrade'
27+
];
28+
29+
// add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' }
30+
packageNames.forEach(function (pkgName) {
31+
packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
32+
});
33+
34+
var config = {
35+
map: map,
36+
packages: packages
37+
}
38+
39+
// filterSystemConfig - index.html's chance to modify config before we register it.
40+
if (global.filterSystemConfig) { global.filterSystemConfig(config); }
41+
42+
System.config(config);
43+
44+
})(this);

src/ASP.NET-Core-SPAs/Views/Home/Angular2.cshtml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,15 @@
22
<head>
33
<title>Angular 2 QuickStart</title>
44

5-
<script src="~/Angular/angular2-polyfills.js"></script>
6-
<script src="~/Angular/system.src.js"></script>
7-
<script src="~/Angular/Rx.js"></script>
8-
<script src="~/Angular/angular2.dev.js"></script>
9-
<script src="~/Angular/http.dev.js"></script>
5+
<script src="~/Angular/lib/es6-shim/es6-shim.min.js"></script>
106

7+
<script src="~/Angular/lib/zone.js/dist/zone.js"></script>
8+
<script src="~/Angular/lib/reflect-metadata/Reflect.js"></script>
9+
<script src="~/Angular/lib/systemjs/dist/system.src.js"></script>
10+
11+
<script src="~/Angular/app/systemjs.config.js"></script>
1112
<script>
12-
System.config({
13-
packages: {
14-
'../Angular': {
15-
format: 'register',
16-
defaultExtension: 'js'
17-
}
18-
}
19-
});
20-
System.import('../Angular/app/boot')
21-
.then(null, console.error.bind(console));
13+
System.import('app').catch(function(err){ console.error(err); });
2214
</script>
2315

2416
</head>

src/ASP.NET-Core-SPAs/gulpfile.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <binding Clean='clean' />
1+
/// <binding AfterBuild='angular2:moveJs' Clean='clean' />
22
"use strict";
33

44
var gulp = require("gulp"),
@@ -46,14 +46,24 @@ gulp.task("min", ["min:js", "min:css"]);
4646

4747
gulp.task("angular2:moveLibs", function () {
4848
return gulp.src([
49-
"node_modules/angular2/bundles/angular2-polyfills.js",
49+
"node_modules/@angular/common/**/*",
50+
"node_modules/@angular/compiler/**/*",
51+
"node_modules/@angular/core/**/*",
52+
"node_modules/@angular/http/**/*",
53+
"node_modules/@angular/platform-browser/**/*",
54+
"node_modules/@angular/platform-browser-dynamic/**/*",
55+
"node_modules/@angular/router/**/*",
56+
"node_modules/@angular/router-deprecated/**/*",
57+
"node_modules/@angular/upgrade/**/*",
5058
"node_modules/systemjs/dist/system.src.js",
5159
"node_modules/systemjs/dist/system-polyfills.js",
52-
"node_modules/rxjs/bundles/Rx.js",
53-
"node_modules/angular2/bundles/angular2.dev.js",
54-
"node_modules/angular2/bundles/http.dev.js"
55-
])
56-
.pipe(gulp.dest(paths.webroot + "Angular"));
60+
"node_modules/rxjs/**/*",
61+
"node_modules/es6-shim/es6-shim.min.js",
62+
"node_modules/zone.js/dist/zone.js",
63+
"node_modules/reflect-metadata/Reflect.js"
64+
],
65+
{ base: "node_modules" })
66+
.pipe(gulp.dest(paths.webroot + "Angular/lib"));
5767

5868
});
5969

0 commit comments

Comments
 (0)