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,5 @@
|
||||
<ul>
|
||||
<li *ngFor="let hero of heroes">
|
||||
{{hero.name}}
|
||||
</li>
|
||||
</ul>
|
@ -0,0 +1,18 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { Hero, HeroService } from './heroes';
|
||||
|
||||
@Component({
|
||||
selector: 'sg-app',
|
||||
templateUrl: './app.component.html',
|
||||
providers: [HeroService]
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
heroes: Hero[];
|
||||
|
||||
constructor(private heroService: HeroService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.heroService.getHeroes().subscribe(heroes => this.heroes = heroes);
|
||||
}
|
||||
}
|
17
aio/content/examples/styleguide/src/07-01/app/app.module.ts
Normal file
17
aio/content/examples/styleguide/src/07-01/app/app.module.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
BrowserModule,
|
||||
RouterModule.forChild([{ path: '07-01', component: AppComponent }])
|
||||
],
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
exports: [ AppComponent ]
|
||||
})
|
||||
export class AppModule {}
|
@ -0,0 +1 @@
|
||||
export * from './shared';
|
@ -0,0 +1,5 @@
|
||||
// #docregion
|
||||
export class Hero {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
// #docregion
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Http, Response } from '@angular/http';
|
||||
|
||||
import { Hero } from './hero.model';
|
||||
|
||||
@Injectable()
|
||||
// #docregion example
|
||||
export class HeroService {
|
||||
constructor(private http: Http) { }
|
||||
|
||||
getHeroes() {
|
||||
return this.http.get('api/heroes')
|
||||
.map((response: Response) => <Hero[]>response.json().data);
|
||||
}
|
||||
}
|
||||
// #enddocregion example
|
@ -0,0 +1,2 @@
|
||||
export * from './hero.model';
|
||||
export * from './hero.service';
|
2
aio/content/examples/styleguide/src/07-01/app/index.ts
Normal file
2
aio/content/examples/styleguide/src/07-01/app/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './heroes';
|
||||
export * from './app.component';
|
Reference in New Issue
Block a user