I have a controller attached to a state, and everytime said state is accessed, I need my controller to run a block where I do a verification.
How can I do this?
I have a controller attached to a state, and everytime said state is accessed, I need my controller to run a block where I do a verification.
How can I do this?
controller do execute each time you can call an function for example init() function like below
In order to call a particular function every time your location changes, you can also define the function in html as:
So whenever the particular div in html is loaded the function is called automatically.
Hence upon change of state function is called
For reloading controller every time you should mention
reload: true
option on you.state
declaration of ui-routerSample Code
Also you could refer this SO Question