feat(ivy): emit metadata along with all Angular types (#26860)
This commit causes a call to setClassMetadata() to be emitted for every type being compiled by ngtsc (every Angular type). With this metadata, the TestBed should be able to recompile these classes when overriding decorator information. Testing strategy: Tests in the previous commit for generateSetClassMetadataCall() verify that the metadata as generated is correct. This commit enables the generation for each DecoratorHandler, and a test is added to ngtsc_spec to verify all decorated types have metadata generated for them. PR Close #26860
This commit is contained in:

committed by
Matias Niemelä

parent
492576114d
commit
8634d0bcd8
@ -127,8 +127,11 @@ describe('Renderer', () => {
|
||||
decorators: [jasmine.objectContaining({name: 'Directive'})],
|
||||
}));
|
||||
expect(addDefinitionsSpy.calls.first().args[2])
|
||||
.toEqual(
|
||||
`A.ngDirectiveDef = ɵngcc0.ɵdefineDirective({ type: A, selectors: [["", "a", ""]], factory: function A_Factory(t) { return new (t || A)(); } });`);
|
||||
.toEqual(`/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[a]' }]
|
||||
}], null, { foo: [] });
|
||||
A.ngDirectiveDef = ɵngcc0.ɵdefineDirective({ type: A, selectors: [["", "a", ""]], factory: function A_Factory(t) { return new (t || A)(); } });`);
|
||||
});
|
||||
|
||||
it('should call removeDecorators with the source code, a map of class decorators that have been analyzed',
|
||||
|
Reference in New Issue
Block a user