feat(ivy): setClassMetadata() for assigning decorator metadata (#26860)
This commit introduces the setClassMetadata() private function, which adds metadata to a type in a way that can be accessed via Angular's ReflectionCapabilities. Currently, it writes to static fields as if the metadata being added was downleveled from decorators by tsickle. The plan is for ngtsc to emit code which calls this function, passing metadata on to the runtime for testing purposes. Calls to this function would then be tree-shaken away for production bundles. Testing strategy: proper operation of this function will be an integral part of TestBed metadata overriding. Angular core tests will fail if this is broken. PR Close #26860
This commit is contained in:

committed by
Matias Niemelä

parent
afbee736ea
commit
ca1e538752
@ -23,8 +23,10 @@ export {InjectableDef as ɵInjectableDef, InjectorDef as ɵInjectorDef, defineIn
|
||||
export {inject} from './di/injector_compatibility';
|
||||
export {NgModuleDef as ɵNgModuleDef, NgModuleDefWithMeta as ɵNgModuleDefWithMeta} from './metadata/ng_module';
|
||||
export {defineNgModule as ɵdefineNgModule} from './render3/definition';
|
||||
export {setClassMetadata as ɵsetClassMetadata} from './render3/metadata';
|
||||
export {NgModuleFactory as ɵNgModuleFactory} from './render3/ng_module_ref';
|
||||
|
||||
|
||||
/**
|
||||
* The existence of this constant (in this particular file) informs the Angular compiler that the
|
||||
* current program is actually @angular/core, which needs to be compiled specially.
|
||||
|
Reference in New Issue
Block a user