fix(ivy): update the compiler specification (#21656)
Also make a minor fix for directive definitions PR Close #21656
This commit is contained in:
parent
8e8924ac7c
commit
21e37e47c6
|
@ -36,8 +36,11 @@ export function defineComponent<T>(componentDefinition: ComponentDefArgs<T>): Co
|
||||||
n: componentDefinition.factory,
|
n: componentDefinition.factory,
|
||||||
tag: (componentDefinition as ComponentDefArgs<T>).tag || null !,
|
tag: (componentDefinition as ComponentDefArgs<T>).tag || null !,
|
||||||
template: (componentDefinition as ComponentDefArgs<T>).template || null !,
|
template: (componentDefinition as ComponentDefArgs<T>).template || null !,
|
||||||
r: componentDefinition.refresh ||
|
r: componentDefinition.refresh || (componentDefinition.template ?
|
||||||
function(d: number, e: number) { componentRefresh(d, e, componentDefinition.template); },
|
function(d: number, e: number) {
|
||||||
|
componentRefresh(d, e, componentDefinition.template);
|
||||||
|
} :
|
||||||
|
noop),
|
||||||
h: componentDefinition.hostBindings || noop,
|
h: componentDefinition.hostBindings || noop,
|
||||||
inputs: invertObject(componentDefinition.inputs),
|
inputs: invertObject(componentDefinition.inputs),
|
||||||
outputs: invertObject(componentDefinition.outputs),
|
outputs: invertObject(componentDefinition.outputs),
|
||||||
|
|
|
@ -95,6 +95,7 @@ describe('compiler specification', () => {
|
||||||
r3.T(3, '!');
|
r3.T(3, '!');
|
||||||
}
|
}
|
||||||
ChildComponent.ngComponentDef.r(1, 0);
|
ChildComponent.ngComponentDef.r(1, 0);
|
||||||
|
SomeDirective.ngDirectiveDef.r(2, 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// /NORMATIVE
|
// /NORMATIVE
|
||||||
|
@ -112,7 +113,7 @@ describe('compiler specification', () => {
|
||||||
xit('should support structural directives', () => {
|
xit('should support structural directives', () => {
|
||||||
const log: string[] = [];
|
const log: string[] = [];
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: 'if',
|
selector: '[if]',
|
||||||
})
|
})
|
||||||
class IfDirective {
|
class IfDirective {
|
||||||
constructor(template: TemplateRef<any>) { log.push('ifDirective'); }
|
constructor(template: TemplateRef<any>) { log.push('ifDirective'); }
|
||||||
|
@ -180,7 +181,8 @@ describe('compiler specification', () => {
|
||||||
r3.e();
|
r3.e();
|
||||||
r3.T(2);
|
r3.T(2);
|
||||||
}
|
}
|
||||||
r3.t(2, r3.b1('Hello ', r3.m<any>(1).value, '!'));
|
const l1_user = r3.m<any>(1);
|
||||||
|
r3.t(2, r3.b1('Hello ', l1_user.value, '!'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// NORMATIVE
|
// NORMATIVE
|
||||||
|
|
Loading…
Reference in New Issue