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:
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import {StaticReflector, StaticReflectorHost, StaticSymbol} from '@angular/compiler-cli/src/static_reflector';
|
||||
import {HostListenerMetadata, animate, group, keyframes, sequence, state, style, transition, trigger} from '@angular/core';
|
||||
import {HostListener, animate, group, keyframes, sequence, state, style, transition, trigger} from '@angular/core';
|
||||
import {ListWrapper} from '@angular/facade/src/collection';
|
||||
import {isBlank} from '@angular/facade/src/lang';
|
||||
import {MetadataCollector} from '@angular/tsc-wrapped';
|
||||
@ -92,7 +92,7 @@ describe('StaticReflector', () => {
|
||||
host.findDeclaration('src/app/hero-detail.component', 'HeroDetailComponent');
|
||||
let props = reflector.propMetadata(HeroDetailComponent);
|
||||
expect(props['hero']).toBeTruthy();
|
||||
expect(props['onMouseOver']).toEqual([new HostListenerMetadata('mouseover', ['$event'])]);
|
||||
expect(props['onMouseOver']).toEqual([new HostListener('mouseover', ['$event'])]);
|
||||
});
|
||||
|
||||
it('should get an empty object from propMetadata for an unknown class', () => {
|
||||
|
Reference in New Issue
Block a user