Conditionally make input field readonly in Angular 2 or 4: Advice + Best/which way to do it

后端 未结 4 1555
伪装坚强ぢ
伪装坚强ぢ 2021-02-05 00:34

I was attempting to answer someone elses question. And in doing so realised there was quite a bit of uncertainty in my mind about a few things. I\'m hoping someone can provide f

4条回答
  •  一向
    一向 (楼主)
    2021-02-05 01:38

    You can use .

    In your *.component.ts, initialize the variable:

    private variable: boolean = true;
    

提交回复
热议问题