title: Angular 1/ui-router - pass interpreted data from state to controller
body: <p>I want to pass a data from the <code>state</code> to the controller, I would like the <code>{{ projectName }}</code> be interpreted at the <code>state</code> level (this <code>state</code>) and returns its value (string) directly to the controller.</p>
  
  <p>Is there a way to do this by the <code>resolve</code> (the code in the <code>resolve</code> was only for the test, but we can in fact retrieve the projectName by <code>ProjectUtilService.getProjectName(project)</code>) or the <code>onEnter</code> method or for example to execute a function at the same level of <code>data.title</code> and which return the <code>projectName</code> ...?</p>
  
  <pre><code>.state({
      name: 'project.detail.edit.headers.overlay.comment',
      url: '/comment',
      data: {
          title: '{{ projectName }}'
      },
      component: 'iadAgentMyIadComment',
      resolve: {
          projectName: (project, ProjectUtilService) =&gt; {
              ProjectUtilService.getProjectName(project)
          }
      }
  })
  </code></pre>
  
  <p>EDIT :</p>
  
  <pre><code>  getProjectName(project) {
      return project.contactName
    }
  </code></pre>
  
  <p>for example if ProjectUtilService.getProductName (project) returns "Richard Stallman" i want i found on my controller <code>this.$state.current.data.title</code> which is equal to Richard Stallman</p>