mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
In Angular2Spa, use angular2-template loader as a step towards AoT compilation. Implements #356
This commit is contained in:
@@ -2,8 +2,8 @@ import { Component } from '@angular/core';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app',
|
selector: 'app',
|
||||||
template: require('./app.component.html'),
|
templateUrl: './app.component.html',
|
||||||
styles: [require('./app.component.css')]
|
styleUrls: ['./app.component.css']
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'counter',
|
selector: 'counter',
|
||||||
template: require('./counter.component.html')
|
templateUrl: './counter.component.html'
|
||||||
})
|
})
|
||||||
export class CounterComponent {
|
export class CounterComponent {
|
||||||
public currentCount = 0;
|
public currentCount = 0;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Http } from '@angular/http';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'fetchdata',
|
selector: 'fetchdata',
|
||||||
template: require('./fetchdata.component.html')
|
templateUrl: './fetchdata.component.html'
|
||||||
})
|
})
|
||||||
export class FetchDataComponent {
|
export class FetchDataComponent {
|
||||||
public forecasts: WeatherForecast[];
|
public forecasts: WeatherForecast[];
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'home',
|
selector: 'home',
|
||||||
template: require('./home.component.html')
|
templateUrl: './home.component.html'
|
||||||
})
|
})
|
||||||
export class HomeComponent {
|
export class HomeComponent {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { Component } from '@angular/core';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'nav-menu',
|
selector: 'nav-menu',
|
||||||
template: require('./navmenu.component.html'),
|
templateUrl: './navmenu.component.html',
|
||||||
styles: [require('./navmenu.component.css')]
|
styleUrls: ['./navmenu.component.css']
|
||||||
})
|
})
|
||||||
export class NavMenuComponent {
|
export class NavMenuComponent {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"@angular/router": "3.0.2",
|
"@angular/router": "3.0.2",
|
||||||
"@types/node": "^6.0.42",
|
"@types/node": "^6.0.42",
|
||||||
"angular2-platform-node": "~2.0.11",
|
"angular2-platform-node": "~2.0.11",
|
||||||
|
"angular2-template-loader": "^0.6.0",
|
||||||
"angular2-universal": "~2.0.11",
|
"angular2-universal": "~2.0.11",
|
||||||
"angular2-universal-polyfills": "~2.0.11",
|
"angular2-universal-polyfills": "~2.0.11",
|
||||||
"aspnet-prerendering": "^1.0.7",
|
"aspnet-prerendering": "^1.0.7",
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
"expose-loader": "^0.7.1",
|
"expose-loader": "^0.7.1",
|
||||||
"extract-text-webpack-plugin": "^1.0.1",
|
"extract-text-webpack-plugin": "^1.0.1",
|
||||||
"file-loader": "^0.9.0",
|
"file-loader": "^0.9.0",
|
||||||
|
"html-loader": "^0.4.4",
|
||||||
"isomorphic-fetch": "^2.2.1",
|
"isomorphic-fetch": "^2.2.1",
|
||||||
"jquery": "^2.2.1",
|
"jquery": "^2.2.1",
|
||||||
"preboot": "^4.5.2",
|
"preboot": "^4.5.2",
|
||||||
@@ -37,8 +39,8 @@
|
|||||||
"url-loader": "^0.5.7",
|
"url-loader": "^0.5.7",
|
||||||
"webpack": "^1.13.2",
|
"webpack": "^1.13.2",
|
||||||
"webpack-hot-middleware": "^2.12.2",
|
"webpack-hot-middleware": "^2.12.2",
|
||||||
"webpack-node-externals": "^1.4.3",
|
|
||||||
"webpack-merge": "^0.14.1",
|
"webpack-merge": "^0.14.1",
|
||||||
|
"webpack-node-externals": "^1.4.3",
|
||||||
"zone.js": "^0.6.25"
|
"zone.js": "^0.6.25"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ var sharedConfig = {
|
|||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{ test: /\.ts$/, include: /ClientApp/, loader: 'ts', query: { silent: true } },
|
{ test: /\.ts$/, include: /ClientApp/, loaders: ['ts?silent=true', 'angular2-template'] },
|
||||||
{ test: /\.html$/, loader: 'raw' },
|
{ test: /\.html$/, loader: 'html' },
|
||||||
{ test: /\.css$/, loader: 'to-string!css' },
|
{ test: /\.css$/, loader: 'to-string!css' },
|
||||||
{ test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url', query: { limit: 25000 } }
|
{ test: /\.(png|jpg|jpeg|gif|svg)$/, loader: 'url', query: { limit: 25000 } }
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user