I have multiple nested views ui-view on my page with corresponding states to set templates in those views. When I transition to a child state, controller associated to each of its parent states gets called. I want to prevent this.
For example, if I transition to state root.question.mcq.menu
, the controller associated with state root.question.mcq
too gets called.
How can I prevent this so that only the controller associated with root.question.mcq.menu
gets called.
It depends where you come from. Do you come from the parent or from a sibling of the target state the parent controller should not be initialized. But if you come from any other state the parent controller will be initialized. If this behavior is wrong for you then you probably have a design issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With