I am using Angular 9 and have following Angular directive :
export type MyDirectiveValue = "foo"|"bar";
@Directive({
selector: '[myDirective]'
})
export class MyDirective implements OnInit {
@Input("myDirective") value: MyDirectiveValue;
ngOnInit() {
console.log(this.value);
}
}
When I use it in my template :
<div *myDirective="'invalid-value'">Hello</div>
I would have expected Ivy to detect that invalid-value is not assignable to type MyDirectiveValue but it's not, I can freely assign any value without getting any template compilation failure.
Any idea ?
fullTemplateTypeCheckfullTemplateTypeCheckwas already set to true in my case, but the documentation was helpful as when I introducedstrictTemplates: trueit fixed my issues, thanks a lot. BTW, if you want to propose the answer, I may accept if to share some kudos ;-)