feature(angular2spa): Angular 2.0, Universal 2.0, TS 2.0

This commit is contained in:
Mark Pieszak
2016-09-17 17:58:01 -04:00
parent bbc95e0ce2
commit 4b356f356b
18 changed files with 273 additions and 1166 deletions

View File

@@ -1,11 +1,9 @@
import * as ng from '@angular/core';
import { ROUTER_DIRECTIVES } from '@angular/router';
import { Component } from '@angular/core';
import { NavMenu } from '../nav-menu/nav-menu';
@ng.Component({
@Component({
selector: 'app',
template: require('./app.html'),
directives: [...ROUTER_DIRECTIVES, NavMenu]
template: require('./app.html')
})
export class App {
}

View File

@@ -1,6 +1,6 @@
import * as ng from '@angular/core';
import { Component } from '@angular/core';
@ng.Component({
@Component({
selector: 'counter',
template: require('./counter.html')
})

View File

@@ -1,7 +1,7 @@
import * as ng from '@angular/core';
import { Component } from '@angular/core';
import { Http } from '@angular/http';
@ng.Component({
@Component({
selector: 'fetch-data',
template: require('./fetch-data.html')
})

View File

@@ -1,6 +1,6 @@
import * as ng from '@angular/core';
import { Component }from '@angular/core';
@ng.Component({
@Component({
selector: 'home',
template: require('./home.html')
})

View File

@@ -0,0 +1,8 @@
// Here we can create "Barrels" so that it's easier to import everything
// within /components
export * from './app/app';
export * from './counter/counter';
export * from './fetch-data/fetch-data';
export * from './home/home';
export * from './nav-menu/nav-menu';

View File

@@ -1,10 +1,8 @@
import * as ng from '@angular/core';
import { ROUTER_DIRECTIVES } from '@angular/router';
import { Component } from '@angular/core';
@ng.Component({
@Component({
selector: 'nav-menu',
template: require('./nav-menu.html'),
directives: [...ROUTER_DIRECTIVES]
template: require('./nav-menu.html')
})
export class NavMenu {
}