Closed michahell closed 9 years ago
Yeah, I can see why that won't work for you. That event isn't the appropriate trigger to load data (even in stock ui-router). Load data when your controller is invoked, or even better, using a state resolve block.
Okay, I believe I also solved it this way :) Thanks for clearing this up!
Am I forgetting something trivial related to the use of ui-router, or somehow some other trivial thing? I was using the default angular router when I switched to ui-router. I then wanted to know how I could keep several views open, and landed on your 'sticky' router properties, awesome!
This relevant part is in my main HTML file that is being served by node-webkit:
My app.js looks like this:
Then, finally, in my overview controller I have the following event listener at the bottom:
The code in that event listener is not being executed the first time the application loads. The first page that is being loaded is my login view. after the login has completed, this is how I load the overview view (and thus controller):
It must somehow be related to what happens when, as I also use the
$viewContentLoaded
event in my login controller, and the code that is in the event listener there DOES get executed.halp!