Encountering an unusual issue with the onEnter callback for a UI-Router state. Originally, my intention was to modify the data.pagetitle
variable in the onEnter callback.
To showcase the problem, I've set up a Plunkr example. In script.js, I included a console.log
on line 13 and 14. It appears that there is a difference in the $state variable between these two lines.
This leads to two questions:
- What is causing the discrepancy in the $state variable between line 13 and 14?
- How can I make changes to a 'data' object within the onEnter callback?