Pass parameter to Angular 4 directive on input

前端 未结 3 922
我寻月下人不归
我寻月下人不归 2021-02-19 19:49

I have an input text field like this


and my dire

3条回答
  •  清酒与你
    2021-02-19 20:44

    In the hope that this helps someone else...the problem is in the template.

    When I pass the input as [myDirective]="A" the A is being intpreted as an undefined variable. Since I wanted to pass the letter A I should have said [myDirective]="'A'"

提交回复
热议问题