Because it is found that resolve is not only triggered when loaded, but also triggered when returning, but the controller obtained is not updated when returning.
In this example, the things obtained by resolve are also put in the service to get them. I originally wanted to try changing to the injection method to see if the situation is the same. If it still doesn't work, I plan to put it in the service or resolve. The data is only used when loaded.
So I wanted to find an example to test it, but the injection always failed.
There is no test injected here. An error will be reported when injected.
http://jsfiddle.net/abelmakihara/x99b2o2p/3/http://jsfiddle.net/abelmakihara/x99b2o2p/3/
That’s it. I looked at it carefully. There is something wrong with your understanding of
ngRoute
. I changed it. Please take a look again: jsFiddleThe main difference is: