refactor(Type): merge Type and ConcreType<?> into Type<?> (#10616)

Closes #9729

BREAKING CHANGE:

`Type` is now `Type<T>` which means that in most cases you have to
use `Type<any>` in place of `Type`.

We don't expect that any user applications use the `Type` type.
This commit is contained in:
Miško Hevery
2016-08-10 18:21:28 -07:00
committed by vikerman
parent 6f4ee6101c
commit b96869afd2
91 changed files with 637 additions and 714 deletions

View File

@ -13,18 +13,18 @@ import {Map} from '../src/facade/collection';
@Injectable()
export class MockNgModuleResolver extends NgModuleResolver {
private _ngModules = new Map<Type, NgModuleMetadata>();
private _ngModules = new Map<Type<any>, NgModuleMetadata>();
constructor(private _injector: Injector) { super(); }
private get _compiler(): Compiler { return this._injector.get(Compiler); }
private _clearCacheFor(component: Type) { this._compiler.clearCacheFor(component); }
private _clearCacheFor(component: Type<any>) { this._compiler.clearCacheFor(component); }
/**
* Overrides the {@link NgModuleMetadata} for a module.
*/
setNgModule(type: Type, metadata: NgModuleMetadata): void {
setNgModule(type: Type<any>, metadata: NgModuleMetadata): void {
this._ngModules.set(type, metadata);
this._clearCacheFor(type);
}
@ -35,7 +35,7 @@ export class MockNgModuleResolver extends NgModuleResolver {
* default
* `NgModuleResolver`, see `setNgModule`.
*/
resolve(type: Type, throwIfNotFound = true): NgModuleMetadata {
resolve(type: Type<any>, throwIfNotFound = true): NgModuleMetadata {
var metadata = this._ngModules.get(type);
if (!metadata) {
metadata = super.resolve(type, throwIfNotFound);