refactor(ivy): move hostBindings calls out of template (#22833)
PR Close #22833
This commit is contained in:

committed by
Misko Hevery

parent
ce63dc6f95
commit
4f21d373b7
@ -39,10 +39,10 @@ export function defineComponent<T>(componentDefinition: ComponentDefArgs<T>): Co
|
||||
const def = <ComponentDef<any>>{
|
||||
type: type,
|
||||
diPublic: null,
|
||||
n: componentDefinition.factory,
|
||||
factory: componentDefinition.factory,
|
||||
tag: (componentDefinition as ComponentDefArgs<T>).tag || null !,
|
||||
template: (componentDefinition as ComponentDefArgs<T>).template || null !,
|
||||
h: componentDefinition.hostBindings || noop,
|
||||
hostBindings: componentDefinition.hostBindings || null,
|
||||
attributes: componentDefinition.attributes || null,
|
||||
inputs: invertObject(componentDefinition.inputs),
|
||||
outputs: invertObject(componentDefinition.outputs),
|
||||
@ -158,8 +158,6 @@ 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