Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 596825a

Browse files
Foxandxsswardbell
authored andcommitted
docs: update all docs to partially comply the style-guide
1 parent 2ccdd86 commit 596825a

File tree

289 files changed

+1062
-960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+1062
-960
lines changed

public/docs/_examples/architecture/ts/app/app.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// #docregion import
2-
import {Component} from '@angular/core';
2+
import { Component } from '@angular/core';
33
// #enddocregion import
4-
import {HeroListComponent} from './hero-list.component';
5-
import {SalesTaxComponent} from './sales-tax.component';
4+
import { HeroListComponent } from './hero-list.component';
5+
import { SalesTaxComponent } from './sales-tax.component';
66

77
@Component({
88
selector: 'my-app',
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import {Injectable, Type} from '@angular/core';
2-
import {Logger} from './logger.service';
3-
import {Hero} from './hero';
1+
import { Injectable, Type } from '@angular/core';
2+
3+
import { Logger } from './logger.service';
4+
import { Hero } from './hero';
45

56
const HEROES = [
67
new Hero('Windstorm', 'Weather mastery'),
@@ -10,15 +11,15 @@ const HEROES = [
1011

1112
@Injectable()
1213
export class BackendService {
13-
constructor(private _logger: Logger) {}
14+
constructor(private logger: Logger) {}
1415

1516
getAll(type:Type) : PromiseLike<any[]>{
1617
if (type === Hero) {
1718
// TODO get from the database
1819
return Promise.resolve<Hero[]>(HEROES);
1920
}
2021
let err = new Error('Cannot get object of this type');
21-
this._logger.error(err);
22+
this.logger.error(err);
2223
throw err;
2324
}
24-
}
25+
}

public/docs/_examples/architecture/ts/app/hero-detail.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import {Component, Input} from '@angular/core';
2-
import {Hero} from './hero';
1+
import { Component, Input} from '@angular/core';
2+
3+
import { Hero } from './hero';
34

45
@Component({
56
selector: 'hero-detail',

public/docs/_examples/architecture/ts/app/hero-list.component.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// #docplaster
2-
import {Component, OnInit} from '@angular/core';
3-
import {Hero} from './hero';
4-
import {HeroDetailComponent} from './hero-detail.component';
5-
import {HeroService} from './hero.service';
2+
import { Component, OnInit } from '@angular/core';
3+
4+
import { Hero } from './hero';
5+
import { HeroDetailComponent } from './hero-detail.component';
6+
import { HeroService } from './hero.service';
67

78
// #docregion metadata
89
// #docregion providers
@@ -24,14 +25,14 @@ export class HeroesComponent { ... }
2425
// #docregion class
2526
export class HeroListComponent implements OnInit {
2627
// #docregion ctor
27-
constructor(private _service: HeroService) { }
28+
constructor(private service: HeroService) { }
2829
// #enddocregion ctor
2930

3031
heroes: Hero[];
3132
selectedHero: Hero;
3233

3334
ngOnInit() {
34-
this.heroes = this._service.getHeroes();
35+
this.heroes = this.service.getHeroes();
3536
}
3637

3738
selectHero(hero: Hero) { this.selectedHero = hero; }
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
import {Injectable} from '@angular/core';
2-
import {Hero} from './hero';
3-
import {BackendService} from './backend.service';
4-
import {Logger} from './logger.service';
1+
import { Injectable } from '@angular/core';
2+
3+
import { Hero } from './hero';
4+
import { BackendService } from './backend.service';
5+
import { Logger } from './logger.service';
56

67
@Injectable()
78
// #docregion class
89
export class HeroService {
910
// #docregion ctor
1011
constructor(
11-
private _backend: BackendService,
12-
private _logger: Logger) { }
12+
private backend: BackendService,
13+
private logger: Logger) { }
1314
// #enddocregion ctor
1415

15-
private _heroes: Hero[] = [];
16+
private heroes: Hero[] = [];
1617

1718
getHeroes() {
18-
this._backend.getAll(Hero).then( (heroes: Hero[]) => {
19-
this._logger.log(`Fetched ${heroes.length} heroes.`);
20-
this._heroes.push(...heroes); // fill cache
19+
this.backend.getAll(Hero).then( (heroes: Hero[]) => {
20+
this.logger.log(`Fetched ${heroes.length} heroes.`);
21+
this.heroes.push(...heroes); // fill cache
2122
});
22-
return this._heroes;
23+
return this.heroes;
2324
}
2425
}
2526
// #enddocregion class

public/docs/_examples/architecture/ts/app/logger.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// #docregion
2-
import {Injectable} from '@angular/core';
2+
import { Injectable } from '@angular/core';
33

44
@Injectable()
55
// #docregion class

public/docs/_examples/architecture/ts/app/main.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {bootstrap} from '@angular/platform-browser-dynamic';
1+
import { bootstrap } from '@angular/platform-browser-dynamic';
22
// #docregion import
3-
import {AppComponent} from './app.component';
3+
import { AppComponent } from './app.component';
44
// #enddocregion import
5-
import {HeroService} from './hero.service';
6-
import {BackendService} from './backend.service';
7-
import {Logger} from './logger.service';
5+
import { HeroService } from './hero.service';
6+
import { BackendService } from './backend.service';
7+
import { Logger } from './logger.service';
88

99
// #docregion bootstrap
1010
bootstrap(AppComponent, [BackendService, HeroService, Logger]);

public/docs/_examples/architecture/ts/app/sales-tax.component.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// #docplaster
22
// #docregion
3-
import {Component} from '@angular/core';
4-
import {SalesTaxService} from './sales-tax.service';
5-
import {TaxRateService} from './tax-rate.service';
3+
import { Component } from '@angular/core';
4+
5+
import { SalesTaxService } from './sales-tax.service';
6+
import { TaxRateService } from './tax-rate.service';
67

78
// #docregion metadata
89
// #docregion providers
@@ -12,7 +13,7 @@ import {TaxRateService} from './tax-rate.service';
1213
template: `
1314
<h2>Sales Tax Calculator</h2>
1415
Amount: <input #amountBox (change)="0">
15-
16+
1617
<div *ngIf="amountBox.value">
1718
The sales tax is
1819
{{ getTax(amountBox.value) | currency:'USD':true:'1.2-2' }}
@@ -31,11 +32,11 @@ export class SalesTaxComponent { ... }
3132
// #docregion class
3233
export class SalesTaxComponent {
3334
// #docregion ctor
34-
constructor(private _salesTaxService: SalesTaxService) { }
35+
constructor(private salesTaxService: SalesTaxService) { }
3536
// #enddocregion ctor
3637

3738
getTax(value:string | number){
38-
return this._salesTaxService.getVAT(value);
39+
return this.salesTaxService.getVAT(value);
3940
}
4041
}
4142
// #enddocregion class
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
// #docregion
2-
import {Injectable, Inject} from '@angular/core';
3-
import {TaxRateService} from './tax-rate.service';
2+
import { Inject, Injectable } from '@angular/core';
3+
4+
import { TaxRateService } from './tax-rate.service';
45

56
// #docregion class
67
@Injectable()
78
export class SalesTaxService {
8-
constructor(private _rateService: TaxRateService) { }
9+
constructor(private rateService: TaxRateService) { }
910
getVAT(value:string | number){
1011
let amount:number;
1112
if (typeof value === "string"){
1213
amount = parseFloat(value);
1314
} else {
1415
amount = value;
1516
}
16-
return (amount || 0) * this._rateService.getRate('VAT');
17+
return (amount || 0) * this.rateService.getRate('VAT');
1718
}
1819
}
19-
// #enddocregion class
20+
// #enddocregion class
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// #docregion
2-
import {Injectable} from '@angular/core';
2+
import { Injectable } from '@angular/core';
33

44
// #docregion class
55
@Injectable()
66
export class TaxRateService {
77
getRate(rateName:string){return 0.10;} // always 10% everywhere
88
}
9-
// #enddocregion class
9+
// #enddocregion class

public/docs/_examples/attribute-directives/ts/app/app.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// #docregion
2-
import {Component} from '@angular/core';
3-
import {HighlightDirective} from './highlight.directive';
2+
import { Component } from '@angular/core';
3+
4+
import { HighlightDirective } from './highlight.directive';
45

56
@Component({
67
selector: 'my-app',

public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// #docregion
2-
import {Directive, ElementRef, Input} from '@angular/core';
2+
import { Directive, ElementRef, Input } from '@angular/core';
33

44
@Directive({
55
selector: '[myHighlight]'
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// #docregion
2-
import {Directive, ElementRef, Input} from '@angular/core';
2+
import { Directive, ElementRef, Input } from '@angular/core';
33

44
@Directive({
55
selector: '[myHighlight]',
@@ -12,20 +12,20 @@ import {Directive, ElementRef, Input} from '@angular/core';
1212
})
1313

1414
export class HighlightDirective {
15-
15+
1616
// #docregion ctor
17-
private _el:HTMLElement;
18-
constructor(el: ElementRef) { this._el = el.nativeElement; }
17+
private el:HTMLElement;
18+
constructor(el: ElementRef) { this.el = el.nativeElement; }
1919
// #enddocregion ctor
2020

2121
// #docregion mouse-methods
22-
onMouseEnter() { this._highlight("yellow"); }
23-
onMouseLeave() { this._highlight(null); }
22+
onMouseEnter() { this.highlight("yellow"); }
23+
onMouseLeave() { this.highlight(null); }
2424

25-
private _highlight(color: string) {
26-
this._el.style.backgroundColor = color;
25+
private highlight(color: string) {
26+
this.el.style.backgroundColor = color;
2727
}
2828
// #enddocregion mouse-methods
2929

3030
}
31-
// #enddocregion
31+
// #enddocregion

public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #docplaster
22
// #docregion full
3-
import {Directive, ElementRef, Input} from '@angular/core';
3+
import { Directive, ElementRef, Input } from '@angular/core';
44

55
@Directive({
66
selector: '[myHighlight]',
@@ -12,9 +12,9 @@ import {Directive, ElementRef, Input} from '@angular/core';
1212

1313
// #docregion class-1
1414
export class HighlightDirective {
15-
15+
1616
private _defaultColor = 'red';
17-
private _el:HTMLElement;
17+
private el:HTMLElement;
1818
// #enddocregion class-1
1919
// #enddocregion full
2020
/*
@@ -37,16 +37,16 @@ export class HighlightDirective {
3737

3838
// #enddocregion class-1
3939
// #docregion class-1
40-
constructor(el: ElementRef) { this._el = el.nativeElement; }
40+
constructor(el: ElementRef) { this.el = el.nativeElement; }
4141

4242
// #docregion mouse-enter
43-
onMouseEnter() { this._highlight(this.highlightColor || this._defaultColor); }
43+
onMouseEnter() { this.highlight(this.highlightColor || this._defaultColor); }
4444
// #enddocregion mouse-enter
45-
onMouseLeave() { this._highlight(null); }
45+
onMouseLeave() { this.highlight(null); }
4646

47-
private _highlight(color:string) {
48-
this._el.style.backgroundColor = color;
47+
private highlight(color:string) {
48+
this.el.style.backgroundColor = color;
4949
}
5050
}
5151
// #enddocregion class-1
52-
// #enddocregion full
52+
// #enddocregion full
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// #docregion
2-
import {bootstrap} from '@angular/platform-browser-dynamic';
3-
import {AppComponent} from './app.component';
2+
import { bootstrap } from '@angular/platform-browser-dynamic';
3+
4+
import { AppComponent } from './app.component';
45

56
bootstrap(AppComponent);
7+

public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {Component} from '@angular/core';
2-
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from '@angular/router-deprecated';
1+
import { Component } from '@angular/core';
2+
import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router-deprecated';
33

4-
import {MovieListComponent} from './movie-list.component';
5-
import {MovieService} from './movie.service';
6-
import {IMovie} from './movie';
7-
import {StringSafeDatePipe} from './date.pipe';
4+
import { MovieListComponent } from './movie-list.component';
5+
import { MovieService } from './movie.service';
6+
import { IMovie } from './movie';
7+
import { StringSafeDatePipe } from './date.pipe';
88

99
@Component({
1010
selector: 'my-app',

public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {Injectable, Pipe} from '@angular/core';
2-
import {DatePipe} from '@angular/common';
1+
import { Injectable, Pipe } from '@angular/core';
2+
import { DatePipe } from '@angular/common';
33

44
@Injectable()
55
// #docregion date-pipe
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// #docregion
2-
import {bootstrap} from '@angular/platform-browser-dynamic';
3-
import {AppComponent} from './app.component';
2+
import { bootstrap } from '@angular/platform-browser-dynamic';
3+
4+
import { AppComponent } from './app.component';
45

56
bootstrap(AppComponent);

public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// #docplaster
22
// #docregion import
3-
import {Component} from '@angular/core';
4-
import {ROUTER_DIRECTIVES} from '@angular/router-deprecated';
3+
import { Component } from '@angular/core';
4+
import { ROUTER_DIRECTIVES } from '@angular/router-deprecated';
55
// #enddocregion import
6-
import {MovieService} from './movie.service';
7-
import {IMovie} from './movie';
8-
import {StringSafeDatePipe} from './date.pipe';
6+
import { MovieService } from './movie.service';
7+
import { IMovie } from './movie';
8+
import { StringSafeDatePipe } from './date.pipe';
99

1010

1111
// #docregion component

public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie.service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import {Injectable} from '@angular/core';
2-
import {IMovie} from './movie';
1+
import { Injectable } from '@angular/core';
2+
3+
import { IMovie } from './movie';
34

45
@Injectable()
56
export class MovieService {

0 commit comments

Comments
 (0)