style(lint): re-format modules/@angular
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
// #docregion Component
|
||||
import {Component, trigger, state, animate, transition, style} from '@angular/core';
|
||||
import {Component, animate, state, style, transition, trigger} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: "my-expando",
|
||||
selector: 'my-expando',
|
||||
styles: [`
|
||||
.toggle-container {
|
||||
background-color:white;
|
||||
@ -15,18 +15,14 @@ import {Component, trigger, state, animate, transition, style} from '@angular/co
|
||||
overflow:hidden;
|
||||
}
|
||||
`],
|
||||
animations: [
|
||||
trigger('openClose', [
|
||||
state('collapsed, void',
|
||||
style({ height:"0px", color: "maroon", borderColor: "maroon" })),
|
||||
state('expanded',
|
||||
style({ height:"*", borderColor:"green", color:"green" })),
|
||||
transition("collapsed <=> expanded", [
|
||||
animate(500, style({ height: '250px'})),
|
||||
animate(500)
|
||||
])
|
||||
])
|
||||
],
|
||||
animations: [trigger(
|
||||
'openClose',
|
||||
[
|
||||
state('collapsed, void', style({height: '0px', color: 'maroon', borderColor: 'maroon'})),
|
||||
state('expanded', style({height: '*', borderColor: 'green', color: 'green'})),
|
||||
transition(
|
||||
'collapsed <=> expanded', [animate(500, style({height: '250px'})), animate(500)])
|
||||
])],
|
||||
template: `
|
||||
<button (click)="expand()">Open</button>
|
||||
<button (click)="collapse()">Closed</button>
|
||||
@ -37,15 +33,9 @@ import {Component, trigger, state, animate, transition, style} from '@angular/co
|
||||
`
|
||||
})
|
||||
export class MyExpandoCmp {
|
||||
stateExpression:string;
|
||||
constructor() {
|
||||
this.collapse();
|
||||
}
|
||||
expand() {
|
||||
this.stateExpression = 'expanded';
|
||||
}
|
||||
collapse() {
|
||||
this.stateExpression = 'collapsed';
|
||||
}
|
||||
stateExpression: string;
|
||||
constructor() { this.collapse(); }
|
||||
expand() { this.stateExpression = 'expanded'; }
|
||||
collapse() { this.stateExpression = 'collapsed'; }
|
||||
}
|
||||
// #enddocregion
|
||||
|
@ -1,10 +1,5 @@
|
||||
import {
|
||||
Inject,
|
||||
ReflectiveInjector,
|
||||
forwardRef,
|
||||
resolveForwardRef,
|
||||
ForwardRefFn
|
||||
} from '@angular/core';
|
||||
import {ForwardRefFn, Inject, ReflectiveInjector, forwardRef, resolveForwardRef} from '@angular/core';
|
||||
|
||||
|
||||
// #docregion forward_ref_fn
|
||||
var ref = forwardRef(() => Lock);
|
||||
@ -26,7 +21,7 @@ expect(door.lock instanceof Lock).toBe(true);
|
||||
// #enddocregion
|
||||
|
||||
// #docregion resolve_forward_ref
|
||||
var ref = forwardRef(() => "refValue");
|
||||
expect(resolveForwardRef(ref)).toEqual("refValue");
|
||||
expect(resolveForwardRef("regularValue")).toEqual("regularValue");
|
||||
var ref = forwardRef(() => 'refValue');
|
||||
expect(resolveForwardRef(ref)).toEqual('refValue');
|
||||
expect(resolveForwardRef('regularValue')).toEqual('regularValue');
|
||||
// #enddocregion
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {NG_VALIDATORS} from '@angular/common';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
|
||||
let MyApp: Function = null;
|
||||
let myValidator: any = null;
|
||||
|
@ -27,7 +27,7 @@ export class AsyncPipeExample {
|
||||
if (this.arrived) {
|
||||
this.reset();
|
||||
} else {
|
||||
this.resolve("hi there!");
|
||||
this.resolve('hi there!');
|
||||
this.arrived = true;
|
||||
}
|
||||
}
|
||||
@ -35,7 +35,7 @@ export class AsyncPipeExample {
|
||||
// #enddocregion
|
||||
|
||||
// #docregion AsyncPipeObservable
|
||||
@Component({selector: "task-cmp", template: "Time: {{ time | async }}"})
|
||||
@Component({selector: 'task-cmp', template: 'Time: {{ time | async }}'})
|
||||
class Task {
|
||||
time = new Observable<number>((observer: Subscriber<number>) => {
|
||||
setInterval(() => observer.next(new Date().getTime()), 500);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Component, Attribute, Directive, Pipe} from '@angular/core';
|
||||
import {Attribute, Component, Directive, Pipe} from '@angular/core';
|
||||
|
||||
var CustomDirective: Function;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Component, createPlatform, coreLoadAndBootstrap, ReflectiveInjector} from '@angular/core';
|
||||
import {BROWSER_PLATFORM_PROVIDERS, BROWSER_APP_PROVIDERS} from '@angular/platform-browser';
|
||||
import {Component, ReflectiveInjector, coreLoadAndBootstrap, createPlatform} from '@angular/core';
|
||||
import {BROWSER_APP_PROVIDERS, BROWSER_PLATFORM_PROVIDERS} from '@angular/platform-browser';
|
||||
|
||||
var appProviders: any[] = [];
|
||||
|
||||
@ -9,6 +9,7 @@ class MyApp {
|
||||
}
|
||||
|
||||
var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PLATFORM_PROVIDERS));
|
||||
var appInjector = ReflectiveInjector.resolveAndCreate([BROWSER_APP_PROVIDERS, appProviders], platform.injector);
|
||||
var appInjector =
|
||||
ReflectiveInjector.resolveAndCreate([BROWSER_APP_PROVIDERS, appProviders], platform.injector);
|
||||
coreLoadAndBootstrap(MyApp, appInjector);
|
||||
// #enddocregion
|
||||
|
Reference in New Issue
Block a user