refactor: add types (#9116)

This commit is contained in:
Victor Berchet
2016-06-09 11:04:15 -07:00
committed by Miško Hevery
parent b60eecfc47
commit 7ce0fc7d47
64 changed files with 711 additions and 718 deletions

View File

@ -64,7 +64,7 @@ class HelloRootCmp3 {
class HelloRootCmp4 {
appRef: any /** TODO #9100 */;
constructor(@Inject(ApplicationRef) appRef: any /** TODO #9100 */) { this.appRef = appRef; }
constructor(@Inject(ApplicationRef) appRef: ApplicationRef) { this.appRef = appRef; }
}
@Component({selector: 'hello-app'})
@ -78,7 +78,7 @@ class HelloRootDirectiveIsNotCmp {
@Component({selector: 'hello-app', template: ''})
class HelloOnDestroyTickCmp implements OnDestroy {
appRef: ApplicationRef;
constructor(@Inject(ApplicationRef) appRef: any /** TODO #9100 */) { this.appRef = appRef; }
constructor(@Inject(ApplicationRef) appRef: ApplicationRef) { this.appRef = appRef; }
ngOnDestroy(): void { this.appRef.tick(); }
}
@ -129,7 +129,7 @@ export function main() {
expect(logger.res.join("")).toContain("Could not compile");
});
it('should throw if no element is found', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
it('should throw if no element is found', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
var logger = new _ArrayLogger();
var exceptionHandler = new ExceptionHandler(logger, false);
@ -144,7 +144,7 @@ export function main() {
if (getDOM().supportsDOMEvents()) {
it('should forward the error to promise when bootstrap fails',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
// Skip for dart since it causes a confusing error message in console when test passes.
var logger = new _ArrayLogger();
var exceptionHandler = new ExceptionHandler(logger, false);
@ -159,7 +159,7 @@ export function main() {
}));
it('should invoke the default exception handler when bootstrap fails',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
var logger = new _ArrayLogger();
var exceptionHandler = new ExceptionHandler(logger, false);
@ -179,7 +179,7 @@ export function main() {
expect(refPromise).not.toBe(null);
});
it('should display hello world', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
it('should display hello world', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
var refPromise = bootstrap(HelloRootCmp, testProviders);
refPromise.then((ref) => {
expect(el).toHaveText('hello world!');
@ -187,7 +187,7 @@ export function main() {
});
}));
it('should support multiple calls to bootstrap', inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
it('should support multiple calls to bootstrap', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
var refPromise1 = bootstrap(HelloRootCmp, testProviders);
var refPromise2 = bootstrap(HelloRootCmp2, testProviders);
PromiseWrapper.all([refPromise1, refPromise2])
@ -199,7 +199,7 @@ export function main() {
}));
it('should not crash if change detection is invoked when the root component is disposed',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
bootstrap(HelloOnDestroyTickCmp, testProviders)
.then((ref) => {
expect(() => ref.destroy()).not.toThrow();
@ -208,7 +208,7 @@ export function main() {
}));
it('should unregister change detectors when components are disposed',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PLATFORM_PROVIDERS));
var app =
ReflectiveInjector.resolveAndCreate([BROWSER_APP_PROVIDERS, BROWSER_APP_COMPILER_PROVIDERS, testProviders],
@ -223,7 +223,7 @@ export function main() {
}));
it("should make the provided bindings available to the application component",
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
var refPromise = bootstrap(
HelloRootCmp3, [testProviders, {provide: "appBinding", useValue: "BoundValue"}]);
@ -234,7 +234,7 @@ export function main() {
}));
it("should avoid cyclic dependencies when root component requires Lifecycle through DI",
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
var refPromise = bootstrap(HelloRootCmp4, testProviders);
refPromise.then((ref) => {
@ -264,7 +264,7 @@ export function main() {
}));
it('should register each application with the testability registry',
inject([AsyncTestCompleter], (async: any /** TODO #9100 */) => {
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
var refPromise1: Promise<ComponentRef<any>> = bootstrap(HelloRootCmp, testProviders);
var refPromise2: Promise<ComponentRef<any>> = bootstrap(HelloRootCmp2, testProviders);