is there any alternative for ng-disabled in angular2?
Here is a solution am using with anular 6.
[readonly]="DateRelatedObject.bool_DatesEdit ? true : false"
plus above given answer
[attr.disabled]="valid == true ? true : null"
did't work for me plus be aware of using null cause it's expecting bool.
[attr.disabled]="valid == true ? true : null"
You have to use null
to remove attr from html element.
To set the disabled
property to true
or false
use
<button [disabled]="!nextLibAvailable" (click)="showNext('library')" class=" btn btn-info btn-xs" title="Next Lib"> {{libraries.name}}">
<i class="fa fa-chevron-right fa-fw"></i>
</button>