From 552985e305df305bdba336c4bf96bb3db98df1a8 Mon Sep 17 00:00:00 2001 From: Rado Kirov Date: Wed, 3 Jun 2015 15:39:20 -0700 Subject: [PATCH] fix(types): parametrize QueryList. --- modules/angular2/src/core/compiler/base_query_list.dart | 7 +++---- modules/angular2/src/core/compiler/base_query_list.ts | 5 ++--- modules/angular2/src/core/compiler/element_injector.ts | 6 +++--- modules/angular2/src/core/compiler/query_list.ts | 2 +- .../angular2/test/core/compiler/element_injector_spec.ts | 4 ++-- modules/angular2/test/core/compiler/integration_spec.ts | 4 ++-- .../angular2/test/core/compiler/query_integration_spec.ts | 4 ++-- modules/angular2/test/core/forward_ref_integration_spec.ts | 4 ++-- 8 files changed, 17 insertions(+), 19 deletions(-) diff --git a/modules/angular2/src/core/compiler/base_query_list.dart b/modules/angular2/src/core/compiler/base_query_list.dart index a8084da2ba..eacb4c3959 100644 --- a/modules/angular2/src/core/compiler/base_query_list.dart +++ b/modules/angular2/src/core/compiler/base_query_list.dart @@ -1,6 +1,5 @@ library angular2.src.core.compiler.base_query_list; -import 'package:angular2/src/core/annotations_impl/annotations.dart'; import 'dart:collection'; /** @@ -10,8 +9,8 @@ import 'dart:collection'; * In the future this class will implement an Observable interface. * For now it uses a plain list of observable callbacks. */ -class BaseQueryList extends Object with IterableMixin { - List _results; +class BaseQueryList extends Object with IterableMixin { + List _results; List _callbacks; bool _dirty; @@ -20,7 +19,7 @@ class BaseQueryList extends Object with IterableMixin { _callbacks = [], _dirty = false; - Iterator get iterator => _results.iterator; + Iterator get iterator => _results.iterator; reset(newList) { _results = newList; diff --git a/modules/angular2/src/core/compiler/base_query_list.ts b/modules/angular2/src/core/compiler/base_query_list.ts index 0277f0fab8..d7d6d7147d 100644 --- a/modules/angular2/src/core/compiler/base_query_list.ts +++ b/modules/angular2/src/core/compiler/base_query_list.ts @@ -1,5 +1,4 @@ import {List, MapWrapper, ListWrapper} from 'angular2/src/facade/collection'; -import {Directive} from 'angular2/src/core/annotations_impl/annotations'; /** * Injectable Objects that contains a live list of child directives in the light Dom of a directive. @@ -10,8 +9,8 @@ import {Directive} from 'angular2/src/core/annotations_impl/annotations'; * * @exportedAs angular2/view */ -export class BaseQueryList { - _results: List; +export class BaseQueryList { + _results: List; _callbacks; _dirty; diff --git a/modules/angular2/src/core/compiler/element_injector.ts b/modules/angular2/src/core/compiler/element_injector.ts index aedc7e34c9..791a8d8f18 100644 --- a/modules/angular2/src/core/compiler/element_injector.ts +++ b/modules/angular2/src/core/compiler/element_injector.ts @@ -947,7 +947,7 @@ export class ElementInjector extends TreeNode { } private _createQueryRef(directive): void { - var queryList = new QueryList(); + var queryList = new QueryList(); if (isBlank(this._query0)) { this._query0 = new QueryRef(directive, queryList, this); } else if (isBlank(this._query1)) { @@ -1515,10 +1515,10 @@ class QueryError extends BaseException { class QueryRef { directive; - list: QueryList; + list: QueryList; originator: ElementInjector; - constructor(directive, list: QueryList, originator: ElementInjector) { + constructor(directive, list: QueryList, originator: ElementInjector) { this.directive = directive; this.list = list; this.originator = originator; diff --git a/modules/angular2/src/core/compiler/query_list.ts b/modules/angular2/src/core/compiler/query_list.ts index 181951c1e6..dca74910a3 100644 --- a/modules/angular2/src/core/compiler/query_list.ts +++ b/modules/angular2/src/core/compiler/query_list.ts @@ -75,7 +75,7 @@ import {BaseQueryList} from './base_query_list'; * * @exportedAs angular2/view */ -export class QueryList extends BaseQueryList { +export class QueryList extends BaseQueryList { /** */ onChange(callback) { return super.onChange(callback); } diff --git a/modules/angular2/test/core/compiler/element_injector_spec.ts b/modules/angular2/test/core/compiler/element_injector_spec.ts index b062dd0341..d95dbf065e 100644 --- a/modules/angular2/test/core/compiler/element_injector_spec.ts +++ b/modules/angular2/test/core/compiler/element_injector_spec.ts @@ -157,8 +157,8 @@ class NeedsAttributeNoType { @Injectable() class NeedsQuery { - query: QueryList; - constructor(@Query(CountingDirective) query: QueryList) { this.query = query; } + query: QueryList; + constructor(@Query(CountingDirective) query: QueryList) { this.query = query; } } @Injectable() diff --git a/modules/angular2/test/core/compiler/integration_spec.ts b/modules/angular2/test/core/compiler/integration_spec.ts index 800c38d053..b1815230a5 100644 --- a/modules/angular2/test/core/compiler/integration_spec.ts +++ b/modules/angular2/test/core/compiler/integration_spec.ts @@ -1540,10 +1540,10 @@ class ToolbarViewContainer { }) @Injectable() class ToolbarComponent { - query: QueryList; + query: QueryList; ctxProp: string; - constructor(@Query(ToolbarPart) query: QueryList) { + constructor(@Query(ToolbarPart) query: QueryList) { this.ctxProp = 'hello world'; this.query = query; } diff --git a/modules/angular2/test/core/compiler/query_integration_spec.ts b/modules/angular2/test/core/compiler/query_integration_spec.ts index a3f190e5d7..4f299a4e4b 100644 --- a/modules/angular2/test/core/compiler/query_integration_spec.ts +++ b/modules/angular2/test/core/compiler/query_integration_spec.ts @@ -98,8 +98,8 @@ class TextDirective { @View({directives: [NgFor], template: '
{{dir.text}}|
'}) @Injectable() class NeedsQuery { - query: QueryList; - constructor(@Query(TextDirective) query: QueryList) { this.query = query; } + query: QueryList; + constructor(@Query(TextDirective) query: QueryList) { this.query = query; } } var _constructiontext = 0; diff --git a/modules/angular2/test/core/forward_ref_integration_spec.ts b/modules/angular2/test/core/forward_ref_integration_spec.ts index 85ce082662..00144e6e34 100644 --- a/modules/angular2/test/core/forward_ref_integration_spec.ts +++ b/modules/angular2/test/core/forward_ref_integration_spec.ts @@ -46,10 +46,10 @@ class App { template: `{{frame.name}}({{lock.name}})` }) class Door { - locks: QueryList; + locks: QueryList; frame: Frame; - constructor(@Query(forwardRef(() => Lock)) locks: QueryList, + constructor(@Query(forwardRef(() => Lock)) locks: QueryList, @Inject(forwardRef(() => Frame)) frame: Frame) { this.frame = frame; this.locks = locks;