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

Commit 074a33a

Browse files
committed
chore: tslint sweep done
1 parent 1cc5284 commit 074a33a

File tree

65 files changed

+199
-261
lines changed

Some content is hidden

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

65 files changed

+199
-261
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ export class HeroesComponent { ... }
2424
*/
2525
// #docregion class
2626
export class HeroListComponent implements OnInit {
27+
heroes: Hero[];
28+
selectedHero: Hero;
29+
2730
// #docregion ctor
2831
constructor(private service: HeroService) { }
2932
// #enddocregion ctor
3033

31-
heroes: Hero[];
32-
selectedHero: Hero;
33-
3434
ngOnInit() {
3535
this.heroes = this.service.getHeroes();
3636
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import { Logger } from './logger.service';
77
@Injectable()
88
// #docregion class
99
export class HeroService {
10+
private heroes: Hero[] = [];
11+
1012
// #docregion ctor
1113
constructor(
1214
private backend: BackendService,
1315
private logger: Logger) { }
1416
// #enddocregion ctor
1517

16-
private heroes: Hero[] = [];
17-
1818
getHeroes() {
1919
this.backend.getAll(Hero).then( (heroes: Hero[]) => {
2020
this.logger.log(`Fetched ${heroes.length} heroes.`);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// #docregion
2-
import { Inject, Injectable } from '@angular/core';
2+
import { Injectable } from '@angular/core';
33

44
import { TaxRateService } from './tax-rate.service';
55

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* tslint:disable:no-unused-variable */
12
// #docregion
23
import { Directive, ElementRef, Input } from '@angular/core';
34

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

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1+
/* tslint:disable:no-unused-variable */
2+
// #docplaster
13
// #docregion
2-
import { Directive, ElementRef, Input } from '@angular/core';
4+
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
35

46
@Directive({
5-
selector: '[myHighlight]',
6-
// #docregion host
7-
host: {
8-
'(mouseenter)': 'onMouseEnter()',
9-
'(mouseleave)': 'onMouseLeave()'
10-
}
11-
// #enddocregion host
7+
selector: '[myHighlight]'
128
})
139

1410
export class HighlightDirective {
@@ -18,9 +14,19 @@ export class HighlightDirective {
1814
constructor(el: ElementRef) { this.el = el.nativeElement; }
1915
// #enddocregion ctor
2016

21-
// #docregion mouse-methods
22-
onMouseEnter() { this.highlight('yellow'); }
23-
onMouseLeave() { this.highlight(null); }
17+
// #docregion mouse-methods, host
18+
@HostListener('mouseenter') onMouseEnter() {
19+
// #enddocregion host
20+
this.highlight('yellow');
21+
// #docregion host
22+
}
23+
24+
@HostListener('mouseleave') onMouseLeave() {
25+
// #enddocregion host
26+
this.highlight(null);
27+
// #docregion host
28+
}
29+
// #enddocregion host
2430

2531
private highlight(color: string) {
2632
this.el.style.backgroundColor = color;

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
// #docplaster
22
// #docregion full
3-
import { Directive, ElementRef, Input } from '@angular/core';
3+
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
44

55
@Directive({
6-
selector: '[myHighlight]',
7-
host: {
8-
'(mouseenter)': 'onMouseEnter()',
9-
'(mouseleave)': 'onMouseLeave()'
10-
}
6+
selector: '[myHighlight]'
117
})
128
// #docregion class-1
139
export class HighlightDirective {
@@ -29,9 +25,13 @@ export class HighlightDirective {
2925
// #enddocregion color
3026

3127
// #docregion mouse-enter
32-
onMouseEnter() { this.highlight(this.highlightColor || this._defaultColor); }
28+
@HostListener('mouseenter') onMouseEnter() {
29+
this.highlight(this.highlightColor || this._defaultColor);
30+
}
3331
// #enddocregion mouse-enter
34-
onMouseLeave() { this.highlight(null); }
32+
@HostListener('mouseleave') onMouseLeave() {
33+
this.highlight(null);
34+
}
3535

3636
private highlight(color: string) {
3737
this.el.style.backgroundColor = color;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Injectable, Pipe } from '@angular/core';
1+
import { Injectable, Pipe, PipeTransform } from '@angular/core';
22
import { DatePipe } from '@angular/common';
33

44
@Injectable()
55
// #docregion date-pipe
66
@Pipe({name: 'date', pure: true})
7-
export class StringSafeDatePipe extends DatePipe {
7+
export class StringSafeDatePipe extends DatePipe implements PipeTransform {
88
transform(value: any, format: string): string {
99
value = typeof value === 'string' ?
1010
Date.parse(value) : value;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* tslint:disable:no-unused-variable */
12
// #docplaster
23
// #docregion import
34
import { Component } from '@angular/core';

public/docs/_examples/cb-component-communication/ts/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if (!/e2e/.test(location.search)) {
2525
}
2626

2727
@Component({
28-
selector: 'app',
28+
selector: 'my-app',
2929
templateUrl: 'app/app.component.html',
3030
directives: directives
3131
})

public/docs/_examples/cb-component-communication/ts/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</head>
2424

2525
<body>
26-
<app>loading...</app>
26+
<my-app>loading...</my-app>
2727
</body>
2828

2929
</html>

0 commit comments

Comments
 (0)