docs(aio): rename cb- files and a few others

This commit is contained in:
Ward Bell
2017-04-21 17:21:45 -07:00
committed by Pete Bacon Darwin
parent c3fa8803d3
commit 93516ea8a1
543 changed files with 467 additions and 510 deletions

View File

@ -0,0 +1,27 @@
import { Component, OnInit } from '@angular/core';
import { ToastService } from './core';
@Component({
selector: 'sg-app',
template: `
<button (click)="show()">Show toast</button>
<button (click)="hide()">Hide toast</button>
`,
providers: [ToastService]
})
export class AppComponent implements OnInit {
constructor(private toastService: ToastService) { }
hide() {
this.toastService.hide();
}
show() {
this.toastService.show();
}
ngOnInit() {
this.toastService.activate('Hello Style Guide!');
}
}

View 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: '03-04', component: AppComponent }])
],
declarations: [
AppComponent
],
exports: [ AppComponent ]
})
export class AppModule {}

View File

@ -0,0 +1 @@
export * from './toast.service';

View File

@ -0,0 +1,27 @@
// #docregion
// #docregion example
/* avoid */
import { Injectable } from '@angular/core';
@Injectable()
export class ToastService {
message: string;
private _toastCount: number;
hide() {
this._toastCount--;
this._log();
}
show() {
this._toastCount++;
this._log();
}
private _log() {
console.log(this.message);
}
}
// #enddocregion example

View File

@ -0,0 +1,32 @@
// #docplaster
// #docregion
// #docregion example
import { Injectable } from '@angular/core';
@Injectable()
export class ToastService {
message: string;
private toastCount: number;
hide() {
this.toastCount--;
this.log();
}
show() {
this.toastCount++;
this.log();
}
private log() {
console.log(this.message);
}
// #enddocregion example
// testing harness
activate(message: string) {
this.message = message;
}
// #docregion example
}
// #enddocregion example

View File

@ -0,0 +1,2 @@
export * from './core';
export * from './app.component';