docs(aio): rename cb- files and a few others
This commit is contained in:

committed by
Pete Bacon Darwin

parent
c3fa8803d3
commit
93516ea8a1
@ -0,0 +1,13 @@
|
||||
// #docregion
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { HeroService } from './heroes';
|
||||
|
||||
@Component({
|
||||
selector: 'toh-app',
|
||||
template: `
|
||||
<toh-heroes></toh-heroes>
|
||||
`,
|
||||
providers: [HeroService]
|
||||
})
|
||||
export class AppComponent {}
|
19
aio/content/examples/styleguide/src/07-03/app/app.module.ts
Normal file
19
aio/content/examples/styleguide/src/07-03/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { HeroListComponent } from './heroes';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
BrowserModule,
|
||||
RouterModule.forChild([{ path: '07-03', component: AppComponent }])
|
||||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
HeroListComponent
|
||||
],
|
||||
exports: [ AppComponent ]
|
||||
})
|
||||
export class AppModule {}
|
@ -0,0 +1,20 @@
|
||||
// #docregion
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { Hero, HeroService } from '../shared';
|
||||
|
||||
@Component({
|
||||
selector: 'toh-heroes',
|
||||
template: `
|
||||
<pre>{{heroes | json}}</pre>
|
||||
`
|
||||
})
|
||||
export class HeroListComponent implements OnInit {
|
||||
heroes: Hero[] = [];
|
||||
|
||||
constructor(private heroService: HeroService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.heroService.getHeroes().subscribe(heroes => this.heroes = heroes);
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
export * from './hero-list.component';
|
@ -0,0 +1,2 @@
|
||||
export * from './hero-list';
|
||||
export * from './shared';
|
@ -0,0 +1,5 @@
|
||||
// #docregion
|
||||
export class Hero {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
// #docregion
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/of';
|
||||
|
||||
import { Hero } from './hero.model';
|
||||
|
||||
@Injectable()
|
||||
export class HeroService {
|
||||
getHeroes() {
|
||||
let heroes: Hero[] = [];
|
||||
return Observable.of(heroes);
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
// #docregion
|
||||
export * from './hero.model';
|
||||
export * from './hero.service';
|
2
aio/content/examples/styleguide/src/07-03/app/index.ts
Normal file
2
aio/content/examples/styleguide/src/07-03/app/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './heroes';
|
||||
export * from './app.component';
|
Reference in New Issue
Block a user