dimanche 10 mai 2015

Disable button using form validation using angularjs

I have an angular application that contains a save button with several input fields.In the form I have User field if we try to enter inactive user it would call API and show the error message (400 status) "user is not active" in the UI.My requirement is I need to disable save button only if I get server side error "user is not active" error message. I am trying to compare error message like below in the save button but getting error "Cannot assign to read only property".How can I make it work?

<div>

  <md-button> type="submit" ng-disabled="form.User.$error='User is not active'"</md-button>

</div>

Aucun commentaire:

Enregistrer un commentaire