feat(core): add ngOnInit and ngDoCheck support in render3 (#21156)
PR Close #21156
This commit is contained in:

committed by
Miško Hevery

parent
8bf1305490
commit
c516bc3b35
@ -39,6 +39,7 @@ export function defineComponent<T>(componentDefinition: ComponentDefArgs<T>): Co
|
||||
template: (componentDefinition as ComponentDefArgs<T>).template || null !,
|
||||
r: componentDefinition.refresh ||
|
||||
function(d: number, e: number) { componentRefresh(d, e, componentDefinition.template); },
|
||||
h: componentDefinition.hostBindings || noop,
|
||||
inputs: invertObject(componentDefinition.inputs),
|
||||
outputs: invertObject(componentDefinition.outputs),
|
||||
methods: invertObject(componentDefinition.methods),
|
||||
@ -59,6 +60,8 @@ export function PublicFeature<T>(definition: DirectiveDef<T>) {
|
||||
|
||||
const EMPTY = {};
|
||||
|
||||
function noop() {}
|
||||
|
||||
/** Swaps the keys and values of an object. */
|
||||
function invertObject(obj: any): any {
|
||||
if (obj == null) return EMPTY;
|
||||
|
Reference in New Issue
Block a user