From 34447904b9d109ea5605747bf1f4d1e78d657d7e Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 14 Jun 2016 17:39:53 +0200 Subject: [PATCH] make the example lintable --- gulpfile.js | 5 ++- .../ts/app/hero-list-auto.component.ts | 9 +++-- .../ts/app/hero-list-basic.component.ts | 4 +-- .../ts/app/hero-list-classes.component.ts | 7 ++-- ...ero-list-combined-transitions.component.ts | 4 +-- .../hero-list-enter-leave-states.component.ts | 7 ++-- .../ts/app/hero-list-enter-leave.component.ts | 7 ++-- .../ts/app/hero-list-groups.component.ts | 4 +-- .../app/hero-list-inline-styles.component.ts | 5 ++- .../ts/app/hero-list-keyframes.component.ts | 5 +-- .../ts/app/hero-list-multistep.component.ts | 5 ++- .../ts/app/hero-list-timings.component.ts | 7 ++-- .../ts/app/hero-list-twoway.component.ts | 4 +-- .../ts/app/hero-team-builder.component.ts | 14 +++++--- .../animations/ts/app/hero.service.ts | 36 +++++++++---------- 15 files changed, 63 insertions(+), 60 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 2c2a426d72..b9fe91c03d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -670,7 +670,10 @@ gulp.task('lint', function() { '!./public/docs/_examples/**/node_modules/**/*', '!./public/docs/_examples/_protractor/**/*', '!./public/docs/_examples/**/typings/**/*', - '!./public/docs/_examples/**/typings-ng1/**/*' + '!./public/docs/_examples/**/typings-ng1/**/*', + // temporary until codelyzer is fixed mgechev/codelyzer#60 + '!./public/docs/_examples/animations/ts/app/hero.service.ts' + ]) .pipe(tslint({ rulesDirectory: ['node_modules/codelyzer'], diff --git a/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts b/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts index 46358ef4da..090f407e50 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts @@ -5,10 +5,9 @@ import { state, style, animate, - transition, - group + transition } from '@angular/core'; -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -24,7 +23,7 @@ import { Hero, Heroes } from './hero.service'; `, // #enddocregion template styleUrls: ['hero-list.component.css'], - + /* When the element leaves (transition "in => void" occurs), * get the element's current computed height and animate * it down to 0. @@ -42,5 +41,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListAutoComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-basic.component.ts b/public/docs/_examples/animations/ts/app/hero-list-basic.component.ts index 00be0bd2a5..702e902cf5 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-basic.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-basic.component.ts @@ -11,7 +11,7 @@ import { animate } from '@angular/core'; // #enddocregion imports -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -64,5 +64,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListBasicComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-classes.component.ts b/public/docs/_examples/animations/ts/app/hero-list-classes.component.ts index 07f35f10b8..459cd3c651 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-classes.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-classes.component.ts @@ -5,10 +5,9 @@ import { state, style, animate, - transition, - group + transition } from '@angular/core'; -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -42,5 +41,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListClassesComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-combined-transitions.component.ts b/public/docs/_examples/animations/ts/app/hero-list-combined-transitions.component.ts index b6306e4b08..8847cb7ece 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-combined-transitions.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-combined-transitions.component.ts @@ -10,7 +10,7 @@ import { animate } from '@angular/core'; // #enddocregion imports -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -53,5 +53,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListCombinedTransitionsComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-enter-leave-states.component.ts b/public/docs/_examples/animations/ts/app/hero-list-enter-leave-states.component.ts index 9c0b0d6bbb..f6e90faa7c 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-enter-leave-states.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-enter-leave-states.component.ts @@ -5,10 +5,9 @@ import { state, style, animate, - transition, - group + transition } from '@angular/core'; -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -58,5 +57,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListEnterLeaveStatesComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-enter-leave.component.ts b/public/docs/_examples/animations/ts/app/hero-list-enter-leave.component.ts index b654764649..b0f75420be 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-enter-leave.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-enter-leave.component.ts @@ -5,10 +5,9 @@ import { state, style, animate, - transition, - group + transition } from '@angular/core'; -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -46,5 +45,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListEnterLeaveComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-groups.component.ts b/public/docs/_examples/animations/ts/app/hero-list-groups.component.ts index e45f7f5d54..627806752d 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-groups.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-groups.component.ts @@ -8,7 +8,7 @@ import { transition, group } from '@angular/core'; -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -74,5 +74,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListGroupsComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-inline-styles.component.ts b/public/docs/_examples/animations/ts/app/hero-list-inline-styles.component.ts index 9af374b9a1..1e68421d35 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-inline-styles.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-inline-styles.component.ts @@ -4,13 +4,12 @@ import { Component, Input, trigger, - state, style, transition, animate } from '@angular/core'; // #enddocregion imports -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -55,5 +54,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListInlineStylesComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-keyframes.component.ts b/public/docs/_examples/animations/ts/app/hero-list-keyframes.component.ts index e86b7f6853..38a580b40f 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-keyframes.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-keyframes.component.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import { Component, Input, @@ -9,7 +10,7 @@ import { transition, group } from '@angular/core'; -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -59,5 +60,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListKeyframesComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-multistep.component.ts b/public/docs/_examples/animations/ts/app/hero-list-multistep.component.ts index ced411194e..5469944ef0 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-multistep.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-multistep.component.ts @@ -6,10 +6,9 @@ import { style, animate, transition, - group, keyframes } from '@angular/core'; -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -53,5 +52,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListMultistepComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-timings.component.ts b/public/docs/_examples/animations/ts/app/hero-list-timings.component.ts index 58458cc9e6..f6a3810f42 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-timings.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-timings.component.ts @@ -5,10 +5,9 @@ import { state, style, animate, - transition, - group + transition } from '@angular/core'; -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -53,5 +52,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListTimingsComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-list-twoway.component.ts b/public/docs/_examples/animations/ts/app/hero-list-twoway.component.ts index 720a20cf07..3febe7602d 100644 --- a/public/docs/_examples/animations/ts/app/hero-list-twoway.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-list-twoway.component.ts @@ -10,7 +10,7 @@ import { animate } from '@angular/core'; // #enddocregion imports -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; @Component({ moduleId: module.id, @@ -52,5 +52,5 @@ import { Hero, Heroes } from './hero.service'; // #enddocregion animationdef }) export class HeroListTwowayComponent { - @Input() heroes:Heroes; + @Input() heroes: Heroes; } diff --git a/public/docs/_examples/animations/ts/app/hero-team-builder.component.ts b/public/docs/_examples/animations/ts/app/hero-team-builder.component.ts index 865fa2e5e2..40ff07ba68 100644 --- a/public/docs/_examples/animations/ts/app/hero-team-builder.component.ts +++ b/public/docs/_examples/animations/ts/app/hero-team-builder.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { Hero, Heroes } from './hero.service'; +import { Heroes } from './hero.service'; import { HeroListBasicComponent } from './hero-list-basic.component'; import { HeroListInlineStylesComponent } from './hero-list-inline-styles.component'; import { HeroListEnterLeaveComponent } from './hero-list-enter-leave.component'; @@ -52,7 +52,10 @@ import { HeroListTimingsComponent } from './hero-list-timings.component';

Enter & Leave & States

-

Enter and leave animations combined with active/inactive state animations. Different enter and leave transitions depending on state.

+

+ Enter and leave animations combined with active/inactive state animations. + Different enter and leave transitions depending on state. +

@@ -82,7 +85,10 @@ import { HeroListTimingsComponent } from './hero-list-timings.component'; @@ -124,5 +130,5 @@ import { HeroListTimingsComponent } from './hero-list-timings.component'; providers: [Heroes] }) export class HeroTeamBuilderComponent { - constructor(private heroes:Heroes) { } + constructor(private heroes: Heroes) { } } diff --git a/public/docs/_examples/animations/ts/app/hero.service.ts b/public/docs/_examples/animations/ts/app/hero.service.ts index 6712707848..2f30dcde99 100644 --- a/public/docs/_examples/animations/ts/app/hero.service.ts +++ b/public/docs/_examples/animations/ts/app/hero.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; -export class Hero { - constructor(public name:string, +class Hero { + constructor(public name: string, public state = 'inactive') { } @@ -10,6 +10,22 @@ export class Hero { } } +let ALL_HEROES = [ + 'Wolverine', + 'Magneto', + 'Emma Frost', + 'Thing', + 'Kitty Pryde', + 'Nightcrawler', + 'Juggernaut', + 'Beast', + 'Captain America', + 'Spider-Man', + 'Puck', + 'Alex Wilder', + 'Doctor Strange' +].map(name => new Hero(name)); + @Injectable() export class Heroes implements Iterable { @@ -36,19 +52,3 @@ export class Heroes implements Iterable { } } - -var ALL_HEROES = [ - 'Wolverine', - 'Magneto', - 'Emma Frost', - 'Thing', - 'Kitty Pryde', - 'Nightcrawler', - 'Juggernaut', - 'Beast', - 'Captain America', - 'Spider-Man', - 'Puck', - 'Alex Wilder', - 'Doctor Strange' -].map(name => new Hero(name));