diff --git a/aio/content/examples/accessibility/src/app/progress-bar.component.ts b/aio/content/examples/accessibility/src/app/progress-bar.component.ts index fe1f5d8c73..f8ae4662d4 100755 --- a/aio/content/examples/accessibility/src/app/progress-bar.component.ts +++ b/aio/content/examples/accessibility/src/app/progress-bar.component.ts @@ -1,3 +1,4 @@ +// tslint:disable: no-host-metadata-property // #docregion progressbar-component import { Component, Input } from '@angular/core'; diff --git a/aio/content/examples/attribute-binding/src/app/comp-with-host-binding.component.ts b/aio/content/examples/attribute-binding/src/app/comp-with-host-binding.component.ts index f41c3d4278..b93c478f6b 100644 --- a/aio/content/examples/attribute-binding/src/app/comp-with-host-binding.component.ts +++ b/aio/content/examples/attribute-binding/src/app/comp-with-host-binding.component.ts @@ -1,16 +1,16 @@ -import { Component } from '@angular/core'; +import { Component, HostBinding } from '@angular/core'; @Component({ selector: 'comp-with-host-binding', template: 'I am a component!', - host: { - '[class.special]': 'isSpecial', - '[style.color]': 'color', - '[style.width]': 'width' - } }) export class CompWithHostBindingComponent { + @HostBinding('class.special') isSpecial = false; + + @HostBinding('style.color') color = 'green'; + + @HostBinding('style.width') width = '200px'; } diff --git a/aio/content/examples/component-interaction/src/app/hero-child.component.ts b/aio/content/examples/component-interaction/src/app/hero-child.component.ts index 4a0b8d4229..d36ffdeeb1 100644 --- a/aio/content/examples/component-interaction/src/app/hero-child.component.ts +++ b/aio/content/examples/component-interaction/src/app/hero-child.component.ts @@ -12,6 +12,6 @@ import { Hero } from './hero'; }) export class HeroChildComponent { @Input() hero: Hero; - @Input('master') masterName: string; + @Input('master') masterName: string; // tslint:disable-line: no-input-rename } // #enddocregion diff --git a/aio/content/examples/dependency-injection-in-action/src/app/parent-finder.component.ts b/aio/content/examples/dependency-injection-in-action/src/app/parent-finder.component.ts index 054c1f9cf0..18df7ddae0 100644 --- a/aio/content/examples/dependency-injection-in-action/src/app/parent-finder.component.ts +++ b/aio/content/examples/dependency-injection-in-action/src/app/parent-finder.component.ts @@ -1,5 +1,4 @@ -/* tslint:disable: no-unused-variable component-selector-name one-line space-before-function-paren */ -/* tslint:disable:*/ +/* tslint:disable: no-unused-variable component-selector one-line space-before-function-paren */ // #docplaster // #docregion import { Component, forwardRef, Optional, SkipSelf } from '@angular/core'; @@ -20,8 +19,7 @@ const DifferentParent = Parent; // The `parentType` defaults to `Parent` when omitting the second parameter. // #docregion provide-the-parent export function provideParent -// #enddocregion provide-parent, provide-the-parent -// #docregion provide-parent +// #enddocregion provide-the-parent (component: any, parentType?: any) { return { provide: parentType || Parent, useExisting: forwardRef(() => component) }; } diff --git a/aio/content/examples/dynamic-component-loader/src/app/ad-banner.component.ts b/aio/content/examples/dynamic-component-loader/src/app/ad-banner.component.ts index 7e686be87a..989bc87b46 100644 --- a/aio/content/examples/dynamic-component-loader/src/app/ad-banner.component.ts +++ b/aio/content/examples/dynamic-component-loader/src/app/ad-banner.component.ts @@ -11,7 +11,7 @@ import { AdComponent } from './ad.component'; template: `
` // #enddocregion ad-host diff --git a/aio/content/examples/dynamic-component-loader/src/app/ad.directive.ts b/aio/content/examples/dynamic-component-loader/src/app/ad.directive.ts index 312e605228..0b47467c88 100644 --- a/aio/content/examples/dynamic-component-loader/src/app/ad.directive.ts +++ b/aio/content/examples/dynamic-component-loader/src/app/ad.directive.ts @@ -1,8 +1,9 @@ +// tslint:disable: directive-selector // #docregion import { Directive, ViewContainerRef } from '@angular/core'; @Directive({ - selector: '[ad-host]', + selector: '[adHost]', }) export class AdDirective { constructor(public viewContainerRef: ViewContainerRef) { } diff --git a/aio/content/examples/elements/src/app/popup.component.ts b/aio/content/examples/elements/src/app/popup.component.ts index a2383ba69a..45fe6ef647 100644 --- a/aio/content/examples/elements/src/app/popup.component.ts +++ b/aio/content/examples/elements/src/app/popup.component.ts @@ -1,6 +1,6 @@ // tslint:disable: variable-name // #docregion -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core'; import { animate, state, style, transition, trigger } from '@angular/animations'; @Component({ @@ -9,9 +9,6 @@ import { animate, state, style, transition, trigger } from '@angular/animations' Popup: {{message}} `, - host: { - '[@state]': 'state', - }, animations: [ trigger('state', [ state('opened', style({transform: 'translateY(0%)'})), @@ -41,6 +38,7 @@ import { animate, state, style, transition, trigger } from '@angular/animations' `] }) export class PopupComponent { + @HostBinding('@state') state: 'opened' | 'closed' = 'closed'; @Input() diff --git a/aio/content/examples/event-binding/src/app/click.directive.ts b/aio/content/examples/event-binding/src/app/click.directive.ts index 4e9e9085b1..a04863fac8 100644 --- a/aio/content/examples/event-binding/src/app/click.directive.ts +++ b/aio/content/examples/event-binding/src/app/click.directive.ts @@ -1,4 +1,4 @@ -/* tslint:disable use-output-property-decorator directive-class-suffix */ +// tslint:disable: directive-selector import { Directive, ElementRef, EventEmitter, Output } from '@angular/core'; @Directive({selector: '[myClick]'}) diff --git a/aio/content/examples/hierarchical-dependency-injection/src/app/hero-tax-return.component.ts b/aio/content/examples/hierarchical-dependency-injection/src/app/hero-tax-return.component.ts index cbca85946a..9ee6325b2e 100644 --- a/aio/content/examples/hierarchical-dependency-injection/src/app/hero-tax-return.component.ts +++ b/aio/content/examples/hierarchical-dependency-injection/src/app/hero-tax-return.component.ts @@ -1,3 +1,4 @@ +// tslint:disable: no-output-native // #docregion import { Component, EventEmitter, Input, Output } from '@angular/core'; import { HeroTaxReturn } from './hero'; diff --git a/aio/content/examples/inputs-outputs/src/app/aliasing/aliasing.component.ts b/aio/content/examples/inputs-outputs/src/app/aliasing/aliasing.component.ts index 8eed8bddbd..c150bcc214 100644 --- a/aio/content/examples/inputs-outputs/src/app/aliasing/aliasing.component.ts +++ b/aio/content/examples/inputs-outputs/src/app/aliasing/aliasing.component.ts @@ -1,9 +1,4 @@ -/* tslint:disable:use-input-property-decorator */ -/* tslint:disable:use-output-property-decorator */ - -/* tslint:disable:no-input-rename */ - - +// tslint:disable: no-input-rename no-output-rename use-input-property-decorator use-output-property-decorator import { Component, EventEmitter, Input, Output } from '@angular/core'; @Component({ diff --git a/aio/content/examples/lifecycle-hooks/e2e/src/app.e2e-spec.ts b/aio/content/examples/lifecycle-hooks/e2e/src/app.e2e-spec.ts index 8aa8ee9f29..6ec9eb2e63 100644 --- a/aio/content/examples/lifecycle-hooks/e2e/src/app.e2e-spec.ts +++ b/aio/content/examples/lifecycle-hooks/e2e/src/app.e2e-spec.ts @@ -135,7 +135,7 @@ describe('Lifecycle hooks', () => { const inputEle = element(by.css('spy-parent input')); const addHeroButtonEle = element(by.cssContainingText('spy-parent button', 'Add Hero')); const resetHeroesButtonEle = element(by.cssContainingText('spy-parent button', 'Reset Heroes')); - const heroEles = element.all(by.css('spy-parent div[mySpy')); + const heroEles = element.all(by.css('spy-parent div[appSpy')); const logEles = element.all(by.css('spy-parent h4 ~ div')); expect(heroEles.count()).toBe(2, 'should have two heroes displayed'); diff --git a/aio/content/examples/lifecycle-hooks/src/app/counter.component.ts b/aio/content/examples/lifecycle-hooks/src/app/counter.component.ts index cddc847136..a2d7b5fd9b 100644 --- a/aio/content/examples/lifecycle-hooks/src/app/counter.component.ts +++ b/aio/content/examples/lifecycle-hooks/src/app/counter.component.ts @@ -13,7 +13,7 @@ import { LoggerService } from './logger.service'; Counter = {{counter}}