refactor(core): remove deprecated @Component.directives and @Component.pipes
BREAKING CHANGE: previously deprecated @Component.directives and @Component.pipes support was removed. All the components and pipes now must be declarated via an NgModule. NgModule is the basic compilation block passed into the Angular compiler via Compiler#compileModuleSync or #compileModuleAsync. Because of this change, the Compiler#compileComponentAsync and #compileComponentSync were removed as well - any code doing compilation should compile module instead using the apis mentioned above. Lastly, since modules are the basic compilation unit, the ngUpgrade module was modified to always require an NgModule to be passed into the UpgradeAdapter's constructor - previously this was optional.
This commit is contained in:
@ -104,16 +104,7 @@ class SomeDirectiveWithViewChild {
|
||||
c: any;
|
||||
}
|
||||
|
||||
class SomeDir {}
|
||||
class SomePipe {}
|
||||
|
||||
@Component({
|
||||
selector: 'sample',
|
||||
template: 'some template',
|
||||
directives: [SomeDir],
|
||||
pipes: [SomePipe],
|
||||
styles: ['some styles']
|
||||
})
|
||||
@Component({selector: 'sample', template: 'some template', styles: ['some styles']})
|
||||
class ComponentWithTemplate {
|
||||
}
|
||||
|
||||
@ -236,8 +227,6 @@ export function main() {
|
||||
it('should read out the template related metadata from the Component metadata', () => {
|
||||
var compMetadata = <ComponentMetadata>resolver.resolve(ComponentWithTemplate);
|
||||
expect(compMetadata.template).toEqual('some template');
|
||||
expect(compMetadata.directives).toEqual([SomeDir]);
|
||||
expect(compMetadata.pipes).toEqual([SomePipe]);
|
||||
expect(compMetadata.styles).toEqual(['some styles']);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user