is there any alternative for ng-disabled in angular2?

后端 未结 5 2109
孤独总比滥情好
孤独总比滥情好 2020-12-02 14:03

I am using angular2 for development and was wondering if there is any alternative for ng-disabled in angular2.

For ex. below code is in angularJS:

5条回答
  •  难免孤独
    2020-12-02 14:30

    [attr.disabled]="valid == true ? true : null"
    

    You have to use null to remove attr from html element.

提交回复
热议问题