title: Strange behaviour in Angular UI-Router onEnter callback
body: <p>I'm having a strange problem with the onEnter callback for a UI-Router state. What I originally wanted to do was to change the variable <code>data.pagetitle</code> in the onEnter callback.</p>
  
  <p>I've created a <a href="http://plnkr.co/edit/r2efUV1su0wQK6Blfk9a?p=preview" rel="nofollow">Plunkr</a> to demonstrate the problem. I put a <code>console.log</code> on line 13 and 14 of script.js. It seems as if the $state variable differs between these two lines.</p>
  
  <p>So two questions: </p>
  
  <ol>
  <li>Why does $state seem to be different on line 13 and 14</li>
  <li>How do I edit a 'data' object in the onEnter callback?</li>
  </ol>