我正在使用 angular2 进行开发,想知道在 angular2 中是否有任何替代 ng-disabled
的方法。
例如。 下面的代码在 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>
只是想知道如何实现此功能? 有什么意见吗?
最佳答案
要将 disabled
属性设置为 true
或 false
使用
<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>
关于angular - angular2 中是否有 ng-disabled 的替代方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37159827/