How to disable the header button?


I have the form and the submit button on the header,

I can no t get the scope of form in header buttons?

Any suggession how to disalbe the button when form is invalid ?

I use ng-cordova for disable /enable the form , but could not get the form in the header button.


It can be done easily, you just need to play a bit.

Let header bar have its own controller.

Also if you already don’t have it create a factory object and within it create a variable both original controller and new header controller will see. When you want to disable header button just set factory variable to whatever you need and let header controller watch for changes on that variable.

For more information open this article:
and search for chapter: Manual Data Sharing Between Controllers. You’ll find a working example.


Setting the controller on the state and then setting ion-nav-bar with a button with ng-class doesn work? I had some problems with ng-if but not with them being out of reach.


Yes that is the one solution ,
But this will create one extra watcher for the every page I need this only for the one registration page ?