mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
chore(ng2-template): upgrade angular 2 template to rc1 version
This commit is contained in:
committed by
SteveSandersonMS
parent
8005427d94
commit
58a1aa3538
@@ -1,14 +1,16 @@
|
|||||||
import 'angular2/bundles/angular2-polyfills';
|
|
||||||
import 'bootstrap';
|
import 'bootstrap';
|
||||||
|
require('zone.js');
|
||||||
|
import 'reflect-metadata';
|
||||||
import './styles/site.css';
|
import './styles/site.css';
|
||||||
|
|
||||||
import { bootstrap } from 'angular2/platform/browser';
|
|
||||||
import { FormBuilder } from 'angular2/common';
|
import { bootstrap } from '@angular/platform-browser-dynamic';
|
||||||
import * as router from 'angular2/router';
|
import { FormBuilder } from '@angular/common';
|
||||||
import { Http, HTTP_PROVIDERS } from 'angular2/http';
|
import * as router from '@angular/router-deprecated';
|
||||||
|
import { Http, HTTP_PROVIDERS } from '@angular/http';
|
||||||
import { App } from './components/app/app';
|
import { App } from './components/app/app';
|
||||||
|
|
||||||
bootstrap(App, [router.ROUTER_BINDINGS, HTTP_PROVIDERS, FormBuilder]);
|
bootstrap(App, [router.ROUTER_PROVIDERS, HTTP_PROVIDERS, FormBuilder]);
|
||||||
|
|
||||||
// Basic hot reloading support. Automatically reloads and restarts the Angular 2 app each time
|
// Basic hot reloading support. Automatically reloads and restarts the Angular 2 app each time
|
||||||
// you modify source files. This will not preserve any application state other than the URL.
|
// you modify source files. This will not preserve any application state other than the URL.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import 'angular2-universal/polyfills';
|
import 'angular2-universal/polyfills';
|
||||||
import * as ngCore from 'angular2/core';
|
import * as ngCore from '@angular/core';
|
||||||
import * as ngRouter from 'angular2/router';
|
import * as ngRouter from '@angular/router-deprecated';
|
||||||
import * as ngUniversal from 'angular2-universal';
|
import * as ngUniversal from 'angular2-universal';
|
||||||
import { BASE_URL, ORIGIN_URL, REQUEST_URL } from 'angular2-universal/common';
|
import { BASE_URL, ORIGIN_URL, REQUEST_URL } from 'angular2-universal/common';
|
||||||
import { App } from './components/app/app';
|
import { App } from './components/app/app';
|
||||||
@@ -10,13 +10,14 @@ export default function (params: any): Promise<{ html: string, globals?: any }>
|
|||||||
ngCore.provide(BASE_URL, { useValue: '/' }),
|
ngCore.provide(BASE_URL, { useValue: '/' }),
|
||||||
ngCore.provide(ORIGIN_URL, { useValue: params.origin }),
|
ngCore.provide(ORIGIN_URL, { useValue: params.origin }),
|
||||||
ngCore.provide(REQUEST_URL, { useValue: params.url }),
|
ngCore.provide(REQUEST_URL, { useValue: params.url }),
|
||||||
ngUniversal.NODE_HTTP_PROVIDERS,
|
...ngUniversal.NODE_PLATFORM_PIPES,
|
||||||
ngUniversal.NODE_ROUTER_PROVIDERS
|
...ngUniversal.NODE_ROUTER_PROVIDERS,
|
||||||
|
...ngUniversal.NODE_HTTP_PROVIDERS,
|
||||||
];
|
];
|
||||||
|
|
||||||
return ngUniversal.bootloader({
|
return ngUniversal.bootloader({
|
||||||
directives: [App],
|
directives: [App],
|
||||||
providers: serverBindings,
|
componentProviders: serverBindings,
|
||||||
async: true,
|
async: true,
|
||||||
preboot: false,
|
preboot: false,
|
||||||
// TODO: Render just the <app> component instead of wrapping it inside an extra HTML document
|
// TODO: Render just the <app> component instead of wrapping it inside an extra HTML document
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as ng from 'angular2/core';
|
import * as ng from '@angular/core';
|
||||||
import * as router from 'angular2/router';
|
import * as router from '@angular/router-deprecated';
|
||||||
import { Http, HTTP_BINDINGS } from 'angular2/http';
|
import { Http, HTTP_BINDINGS } from '@angular/http';
|
||||||
import { NavMenu } from '../nav-menu/nav-menu';
|
import { NavMenu } from '../nav-menu/nav-menu';
|
||||||
import { Home } from '../home/home';
|
import { Home } from '../home/home';
|
||||||
import { FetchData } from '../fetch-data/fetch-data';
|
import { FetchData } from '../fetch-data/fetch-data';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as ng from 'angular2/core';
|
import * as ng from '@angular/core';
|
||||||
|
|
||||||
@ng.Component({
|
@ng.Component({
|
||||||
selector: 'counter',
|
selector: 'counter',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="#forecast of forecasts">
|
<tr *ngFor="let forecast of forecasts">
|
||||||
<td>{{ forecast.dateFormatted }}</td>
|
<td>{{ forecast.dateFormatted }}</td>
|
||||||
<td>{{ forecast.temperatureC }}</td>
|
<td>{{ forecast.temperatureC }}</td>
|
||||||
<td>{{ forecast.temperatureF }}</td>
|
<td>{{ forecast.temperatureF }}</td>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as ng from 'angular2/core';
|
import * as ng from '@angular/core';
|
||||||
import { Http } from 'angular2/http';
|
import { Http } from '@angular/http';
|
||||||
|
|
||||||
@ng.Component({
|
@ng.Component({
|
||||||
selector: 'fetch-data',
|
selector: 'fetch-data',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as ng from 'angular2/core';
|
import * as ng from '@angular/core';
|
||||||
|
|
||||||
@ng.Component({
|
@ng.Component({
|
||||||
selector: 'home',
|
selector: 'home',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as ng from 'angular2/core';
|
import * as ng from '@angular/core';
|
||||||
import * as router from 'angular2/router';
|
import * as router from '@angular/router-deprecated';
|
||||||
|
|
||||||
@ng.Component({
|
@ng.Component({
|
||||||
selector: 'nav-menu',
|
selector: 'nav-menu',
|
||||||
|
|||||||
@@ -18,14 +18,23 @@
|
|||||||
"webpack-hot-middleware": "^2.10.0"
|
"webpack-hot-middleware": "^2.10.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular2": "2.0.0-beta.15",
|
"@angular/common": "^2.0.0-rc.1",
|
||||||
"angular2-universal": "0.98.1",
|
"@angular/compiler": "^2.0.0-rc.1",
|
||||||
|
"@angular/core": "^2.0.0-rc.1",
|
||||||
|
"@angular/http": "^2.0.0-rc.1",
|
||||||
|
"@angular/platform-browser": "^2.0.0-rc.1",
|
||||||
|
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
|
||||||
|
"@angular/platform-server": "2.0.0-rc.1",
|
||||||
|
"@angular/router": "^2.0.0-rc.1",
|
||||||
|
"@angular/router-deprecated": "^2.0.0-rc.1",
|
||||||
|
"angular2-universal": "0.100.3",
|
||||||
"aspnet-prerendering": "^1.0.1",
|
"aspnet-prerendering": "^1.0.1",
|
||||||
"aspnet-webpack": "^1.0.1",
|
"aspnet-webpack": "^1.0.1",
|
||||||
"css": "^2.2.1",
|
"css": "^2.2.1",
|
||||||
"isomorphic-fetch": "^2.2.1",
|
"isomorphic-fetch": "^2.2.1",
|
||||||
"preboot": "2.0.5",
|
"preboot": "^2.0.5",
|
||||||
"rxjs": "5.0.0-beta.2",
|
"rxjs": "^5.0.0-beta.7",
|
||||||
"webpack-externals-plugin": "^1.0.0"
|
"webpack-externals-plugin": "^1.0.0",
|
||||||
|
"zone.js": "^0.6.12"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,21 @@ module.exports = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
entry: {
|
entry: {
|
||||||
vendor: ['angular2-universal-polyfills', 'bootstrap', 'bootstrap/dist/css/bootstrap.css', 'style-loader', 'jquery', 'angular2/core', 'angular2/common', 'angular2/http', 'angular2/router', 'angular2/platform/browser']
|
vendor: [
|
||||||
|
'bootstrap',
|
||||||
|
'bootstrap/dist/css/bootstrap.css',
|
||||||
|
'style-loader',
|
||||||
|
'jquery',
|
||||||
|
'@angular/common',
|
||||||
|
'@angular/compiler',
|
||||||
|
'@angular/core',
|
||||||
|
'@angular/http',
|
||||||
|
'@angular/platform-browser',
|
||||||
|
'@angular/platform-browser-dynamic',
|
||||||
|
'@angular/router-deprecated',
|
||||||
|
'@angular/platform-server',
|
||||||
|
'@angular/router-deprecated',
|
||||||
|
]
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, 'wwwroot', 'dist'),
|
path: path.join(__dirname, 'wwwroot', 'dist'),
|
||||||
|
|||||||
Reference in New Issue
Block a user