Skip to content

Commit 58a1aa3

Browse files
laskoviymishkaSteveSandersonMS
authored andcommitted
chore(ng2-template): upgrade angular 2 template to rc1 version
1 parent 8005427 commit 58a1aa3

File tree

10 files changed

+53
-27
lines changed

10 files changed

+53
-27
lines changed

templates/Angular2Spa/ClientApp/boot-client.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import 'angular2/bundles/angular2-polyfills';
21
import 'bootstrap';
2+
require('zone.js');
3+
import 'reflect-metadata';
34
import './styles/site.css';
45

5-
import { bootstrap } from 'angular2/platform/browser';
6-
import { FormBuilder } from 'angular2/common';
7-
import * as router from 'angular2/router';
8-
import { Http, HTTP_PROVIDERS } from 'angular2/http';
6+
7+
import { bootstrap } from '@angular/platform-browser-dynamic';
8+
import { FormBuilder } from '@angular/common';
9+
import * as router from '@angular/router-deprecated';
10+
import { Http, HTTP_PROVIDERS } from '@angular/http';
911
import { App } from './components/app/app';
1012

11-
bootstrap(App, [router.ROUTER_BINDINGS, HTTP_PROVIDERS, FormBuilder]);
13+
bootstrap(App, [router.ROUTER_PROVIDERS, HTTP_PROVIDERS, FormBuilder]);
1214

1315
// Basic hot reloading support. Automatically reloads and restarts the Angular 2 app each time
1416
// you modify source files. This will not preserve any application state other than the URL.

templates/Angular2Spa/ClientApp/boot-server.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'angular2-universal/polyfills';
2-
import * as ngCore from 'angular2/core';
3-
import * as ngRouter from 'angular2/router';
2+
import * as ngCore from '@angular/core';
3+
import * as ngRouter from '@angular/router-deprecated';
44
import * as ngUniversal from 'angular2-universal';
55
import { BASE_URL, ORIGIN_URL, REQUEST_URL } from 'angular2-universal/common';
66
import { App } from './components/app/app';
@@ -10,13 +10,14 @@ export default function (params: any): Promise<{ html: string, globals?: any }>
1010
ngCore.provide(BASE_URL, { useValue: '/' }),
1111
ngCore.provide(ORIGIN_URL, { useValue: params.origin }),
1212
ngCore.provide(REQUEST_URL, { useValue: params.url }),
13-
ngUniversal.NODE_HTTP_PROVIDERS,
14-
ngUniversal.NODE_ROUTER_PROVIDERS
13+
...ngUniversal.NODE_PLATFORM_PIPES,
14+
...ngUniversal.NODE_ROUTER_PROVIDERS,
15+
...ngUniversal.NODE_HTTP_PROVIDERS,
1516
];
1617

1718
return ngUniversal.bootloader({
1819
directives: [App],
19-
providers: serverBindings,
20+
componentProviders: serverBindings,
2021
async: true,
2122
preboot: false,
2223
// TODO: Render just the <app> component instead of wrapping it inside an extra HTML document

templates/Angular2Spa/ClientApp/components/app/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as ng from 'angular2/core';
2-
import * as router from 'angular2/router';
3-
import { Http, HTTP_BINDINGS } from 'angular2/http';
1+
import * as ng from '@angular/core';
2+
import * as router from '@angular/router-deprecated';
3+
import { Http, HTTP_BINDINGS } from '@angular/http';
44
import { NavMenu } from '../nav-menu/nav-menu';
55
import { Home } from '../home/home';
66
import { FetchData } from '../fetch-data/fetch-data';

templates/Angular2Spa/ClientApp/components/counter/counter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as ng from 'angular2/core';
1+
import * as ng from '@angular/core';
22

33
@ng.Component({
44
selector: 'counter',

templates/Angular2Spa/ClientApp/components/fetch-data/fetch-data.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1>Weather forecast</h1>
1414
</tr>
1515
</thead>
1616
<tbody>
17-
<tr *ngFor="#forecast of forecasts">
17+
<tr *ngFor="let forecast of forecasts">
1818
<td>{{ forecast.dateFormatted }}</td>
1919
<td>{{ forecast.temperatureC }}</td>
2020
<td>{{ forecast.temperatureF }}</td>

templates/Angular2Spa/ClientApp/components/fetch-data/fetch-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as ng from 'angular2/core';
2-
import { Http } from 'angular2/http';
1+
import * as ng from '@angular/core';
2+
import { Http } from '@angular/http';
33

44
@ng.Component({
55
selector: 'fetch-data',

templates/Angular2Spa/ClientApp/components/home/home.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as ng from 'angular2/core';
1+
import * as ng from '@angular/core';
22

33
@ng.Component({
44
selector: 'home',

templates/Angular2Spa/ClientApp/components/nav-menu/nav-menu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as ng from 'angular2/core';
2-
import * as router from 'angular2/router';
1+
import * as ng from '@angular/core';
2+
import * as router from '@angular/router-deprecated';
33

44
@ng.Component({
55
selector: 'nav-menu',

templates/Angular2Spa/package.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,23 @@
1818
"webpack-hot-middleware": "^2.10.0"
1919
},
2020
"dependencies": {
21-
"angular2": "2.0.0-beta.15",
22-
"angular2-universal": "0.98.1",
21+
"@angular/common": "^2.0.0-rc.1",
22+
"@angular/compiler": "^2.0.0-rc.1",
23+
"@angular/core": "^2.0.0-rc.1",
24+
"@angular/http": "^2.0.0-rc.1",
25+
"@angular/platform-browser": "^2.0.0-rc.1",
26+
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
27+
"@angular/platform-server": "2.0.0-rc.1",
28+
"@angular/router": "^2.0.0-rc.1",
29+
"@angular/router-deprecated": "^2.0.0-rc.1",
30+
"angular2-universal": "0.100.3",
2331
"aspnet-prerendering": "^1.0.1",
2432
"aspnet-webpack": "^1.0.1",
2533
"css": "^2.2.1",
2634
"isomorphic-fetch": "^2.2.1",
27-
"preboot": "2.0.5",
28-
"rxjs": "5.0.0-beta.2",
29-
"webpack-externals-plugin": "^1.0.0"
35+
"preboot": "^2.0.5",
36+
"rxjs": "^5.0.0-beta.7",
37+
"webpack-externals-plugin": "^1.0.0",
38+
"zone.js": "^0.6.12"
3039
}
3140
}

templates/Angular2Spa/webpack.config.vendor.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,21 @@ module.exports = {
1515
]
1616
},
1717
entry: {
18-
vendor: ['angular2-universal-polyfills', 'bootstrap', 'bootstrap/dist/css/bootstrap.css', 'style-loader', 'jquery', 'angular2/core', 'angular2/common', 'angular2/http', 'angular2/router', 'angular2/platform/browser']
18+
vendor: [
19+
'bootstrap',
20+
'bootstrap/dist/css/bootstrap.css',
21+
'style-loader',
22+
'jquery',
23+
'@angular/common',
24+
'@angular/compiler',
25+
'@angular/core',
26+
'@angular/http',
27+
'@angular/platform-browser',
28+
'@angular/platform-browser-dynamic',
29+
'@angular/router-deprecated',
30+
'@angular/platform-server',
31+
'@angular/router-deprecated',
32+
]
1933
},
2034
output: {
2135
path: path.join(__dirname, 'wwwroot', 'dist'),

0 commit comments

Comments
 (0)