chore: noImplicitAny fixes

This commit is contained in:
Misko Hevery
2016-02-11 17:01:17 -08:00
committed by vsavkin
parent cfc1e56dd8
commit 8bb66a5eb3
38 changed files with 219 additions and 147 deletions
@@ -1,7 +1,7 @@
import {DebugElement} from 'angular2/core';
var debugElement: DebugElement;
var predicate;
var predicate: any;
// #docregion scope_all
debugElement.query(predicate);
@@ -2,8 +2,8 @@ import {bootstrap} from 'angular2/bootstrap';
import {NG_VALIDATORS} from 'angular2/common';
import {Provider} from 'angular2/core';
let MyApp = null;
let myValidator = null;
let MyApp: Function = null;
let myValidator: any = null;
// #docregion ng_validators
bootstrap(MyApp, [new Provider(NG_VALIDATORS, {useValue: myValidator, multi: true})]);
@@ -1,6 +1,6 @@
import {Component, provide} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {Observable} from 'rxjs/Observable';
import {Observable, Subscriber} from 'rxjs/Rx';
// #docregion AsyncPipe
@Component({
@@ -37,8 +37,9 @@ export class AsyncPipeExample {
// #docregion AsyncPipeObservable
@Component({selector: "task-cmp", template: "Time: {{ time | async }}"})
class Task {
time = new Observable<number>(
observer => { setInterval(_ => observer.next(new Date().getTime()), 500); });
time = new Observable<number>((observer: Subscriber<number>) => {
setInterval(_ => observer.next(new Date().getTime()), 500);
});
}
// #enddocregion
@@ -12,7 +12,7 @@ import {bootstrap} from 'angular2/bootstrap';
})
export class LowerUpperPipeExample {
value: string;
change(value) { this.value = value; }
change(value: string) { this.value = value; }
}
// #enddocregion
@@ -1,6 +1,6 @@
import {Component, Attribute, Directive, Pipe} from 'angular2/core';
var CustomDirective;
var CustomDirective: Function;
// #docregion component
@Component({selector: 'greet', template: 'Hello {{name}}!', directives: [CustomDirective]})
@@ -20,7 +20,7 @@ class Page {
// #docregion attributeMetadata
@Directive({selector: 'input'})
class InputAttrDirective {
constructor(@Attribute('type') type) {
constructor(@Attribute('type') type: string) {
// type would be 'text' in this example
}
}
@@ -38,6 +38,6 @@ class InputDirective {
// #docregion pipe
@Pipe({name: 'lowercase'})
class Lowercase {
transform(v, args) { return v.toLowerCase(); }
transform(v: string, args: any[]) { return v.toLowerCase(); }
}
// #enddocregion
@@ -1,7 +1,7 @@
// #docregion enableProdMode
import {enableProdMode} from 'angular2/core';
import {bootstrap} from 'angular2/bootstrap';
import {MyComponent} from 'my_component';
import {MyComponent} from './my_component';
enableProdMode();
bootstrap(MyComponent);