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:
<button ng-disabled="!nextLibAvailable" ng-click="showNext('library')" class=" btn btn-info btn-xs" title="Next Lib >> {{libraries.name}}">
<i class="fa fa-chevron-right fa-fw"></i>
</button>
Just wanted to know How can I achieve this functionality? any inputs?
You have to use
null
to remove attr from html element.Yes You can either set [disabled]= "true" or if it is an radio button or checkbox then you can simply use disable
For radio button:
For dropdown:
For angular 4+ versions you can try
Here is a solution am using with anular 6.
plus above given answer
did't work for me plus be aware of using null cause it's expecting bool.
To set the
disabled
property totrue
orfalse
use