fix(compiler): dedupe NgModule declarations, …
This is important so that we don’t generate things multiple times.
This commit is contained in:
@ -183,6 +183,22 @@ export function main() {
|
||||
}));
|
||||
});
|
||||
|
||||
it('should dedupe declarations in NgModule',
|
||||
inject([CompileMetadataResolver], (resolver: CompileMetadataResolver) => {
|
||||
|
||||
@Component({template: ''})
|
||||
class MyComp {
|
||||
}
|
||||
|
||||
@NgModule({declarations: [MyComp, MyComp]})
|
||||
class MyModule {
|
||||
}
|
||||
|
||||
const modMeta = resolver.getNgModuleMetadata(MyModule);
|
||||
expect(modMeta.declaredDirectives.length).toBe(1);
|
||||
expect(modMeta.declaredDirectives[0].type.reference).toBe(MyComp);
|
||||
}));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user