refactor(core): remove …Metadata for all decorators and use the decorator directly.

BREAKING CHANGE:
- all `…Metadata` classes have been removed. Use the corresponding decorator
  as constructor or for `instanceof` checks instead.
- Example:
  * Before: `new ComponentMetadata(…)`
  * After: `new Component(…)`
- Note: `new Component(…)` worked before as well.
This commit is contained in:
Tobias Bosch
2016-09-12 19:14:17 -07:00
committed by Igor Minar
parent 1b15170c89
commit 63e15ffaec
40 changed files with 229 additions and 279 deletions

View File

@ -29,7 +29,7 @@ export function devModeEqual(a: any, b: any): boolean {
}
/**
* Indicates that the result of a {@link PipeMetadata} transformation has changed even though the
* Indicates that the result of a {@link Pipe} transformation has changed even though the
* reference
* has not changed.
*

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {OptionalMetadata, Provider, SkipSelfMetadata} from '../../di';
import {Optional, Provider, SkipSelf} from '../../di';
import {ListWrapper} from '../../facade/collection';
import {getTypeNameForDebugging, isBlank, isPresent} from '../../facade/lang';
import {ChangeDetectorRef} from '../change_detector_ref';
@ -91,7 +91,7 @@ export class IterableDiffers {
return IterableDiffers.create(factories, parent);
},
// Dependency technically isn't optional, but we can provide a better error message this way.
deps: [[IterableDiffers, new SkipSelfMetadata(), new OptionalMetadata()]]
deps: [[IterableDiffers, new SkipSelf(), new Optional()]]
};
}

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {OptionalMetadata, Provider, SkipSelfMetadata} from '../../di';
import {Optional, Provider, SkipSelf} from '../../di';
import {ListWrapper} from '../../facade/collection';
import {isBlank, isPresent} from '../../facade/lang';
import {ChangeDetectorRef} from '../change_detector_ref';
@ -81,7 +81,7 @@ export class KeyValueDiffers {
return KeyValueDiffers.create(factories, parent);
},
// Dependency technically isn't optional, but we can provide a better error message this way.
deps: [[KeyValueDiffers, new SkipSelfMetadata(), new OptionalMetadata()]]
deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]
};
}