forgottofly forgottofly - 3 months ago 68
AngularJS Question

ng-disabled not working with <i> tag using font-awesome

I have created a plunk in which I want to validate a form that has a button created using font-awesome.
The text field is required and I want to disabled the icon if no data is entered.But

ng-disabled
dosen't seem to support this functionality with font awesome icon.
Has anyone faced this issue before.Please share your thoughts..

Please find the plunk here

Answer

Place it inside a button and it should work:

    <button ng-disabled="testForm.$invalid" ng-click="$ctrl.checkIfClicked()">
      <i class="fa fa-floppy-o fa-2x"></i>
    </button>

You can format the style of the button in a way you want.