title: Angular 1/ui-router - execute function into data object
body: <p>I want to run a method that returns a string into <code>data</code> object.</p>
  
  <p>For example if the result returned by the method is: "Richard Stallman" I want that on my controller with: this. <code>$state.current.data.title</code> equal to "Richard Stallman"
  as if I simply did :</p>
  
  <pre><code>  data: {
      title: "Richard Stallman"
    }
  </code></pre>
  
  <p>My state :</p>
  
  <pre><code>.state({
    name: 'agent.production.myiad.project.detail.edit.headers.overlay.comment',
    url: '/comment',
    data: {
      title: (project, IadProjectUtilService) =&gt; {
              IadProjectUtilService.getProjectName(project) 
        }
    },
    component: 'iadAgentMyIadComment'
  })
  </code></pre>