UI-Router AngularJs: preventing parent state controller from invoking when transitioning to child state

I have several nested ui-views on my page with the appropriate states for setting templates in these views. When I go to the child state, the controller associated with each of its parent states is called. I want to prevent this. For example, if I go into root.question.mcq.menu state, it also calls the controller associated with root.question.mcq state.

How can I prevent this from root.question.mcq.menu only the controller associated with root.question.mcq.menu .

+6
source share
1 answer

It depends on where you came from. Whether you are from a parent or sibling of a 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 is wrong for you, you probably have a design problem.

+1
source

All Articles