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

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Type} from '@angular/core';
import {Provider} from '@angular/core';
import {CORE_DIRECTIVES} from './directives';
@ -55,4 +55,4 @@ import {CORE_DIRECTIVES} from './directives';
*
* @experimental Contains forms which are experimental.
*/
export const COMMON_DIRECTIVES: Type[][] = [CORE_DIRECTIVES];
export const COMMON_DIRECTIVES: any[] = CORE_DIRECTIVES;

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Type} from '../facade/lang';
import {Type} from '@angular/core';
import {NgClass} from './ng_class';
import {NgFor} from './ng_for';
@ -58,7 +58,7 @@ import {NgTemplateOutlet} from './ng_template_outlet';
*
* @stable
*/
export const CORE_DIRECTIVES: Type[] = [
export const CORE_DIRECTIVES: Type<any>[] = [
NgClass,
NgFor,
NgIf,

View File

@ -57,7 +57,7 @@ export {NG_ASYNC_VALIDATORS, NG_VALIDATORS, Validators} from './forms-deprecated
*
* @experimental
*/
export const FORM_PROVIDERS: Type[] = [FormBuilder, RadioControlRegistry];
export const FORM_PROVIDERS: Type<any>[] = [FormBuilder, RadioControlRegistry];
/**

View File

@ -58,7 +58,7 @@ export {MaxLengthValidator, MinLengthValidator, PatternValidator, RequiredValida
* ```
* @experimental
*/
export const FORM_DIRECTIVES: Type[] = [
export const FORM_DIRECTIVES: Type<any>[] = [
NgControlName,
NgControlGroup,

View File

@ -6,11 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
import {BaseException} from '@angular/core';
import {Type, stringify} from '../facade/lang';
import {BaseException, Type} from '@angular/core';
import {stringify} from '../facade/lang';
export class InvalidPipeArgumentException extends BaseException {
constructor(type: Type, value: Object) {
constructor(type: Type<any>, value: Object) {
super(`Invalid argument '${value}' for pipe '${stringify(type)}'`);
}
}

View File

@ -6,10 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Pipe, PipeTransform} from '@angular/core';
import {Pipe, PipeTransform, Type} from '@angular/core';
import {NumberFormatStyle, NumberFormatter} from '../facade/intl';
import {NumberWrapper, Type, isBlank, isNumber, isPresent, isString} from '../facade/lang';
import {NumberWrapper, isBlank, isNumber, isPresent, isString} from '../facade/lang';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
@ -17,7 +17,7 @@ var defaultLocale: string = 'en-US';
const _NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(\-(\d+))?)?$/;
function formatNumber(
pipe: Type, value: number | string, style: NumberFormatStyle, digits: string,
pipe: Type<any>, value: number | string, style: NumberFormatStyle, digits: string,
currency: string = null, currencyAsSymbol: boolean = false): string {
if (isBlank(value)) return null;
// Convert strings to numbers