title: Angular custom click to edit - input value to function
body: <p>I have a basic click to edit span field in my code, which prompts an input box and a couple of buttons:</p>
  
  <pre><code>    &lt;span ng-click="editField()" ng-if="edit === false"&gt;Your text to edit&lt;/span&gt;
  
      &lt;div ng-if="edit === true"&gt;
          &lt;input type="text" ng-bind="data.field" value="Your text to edit" /&gt;
          &lt;button type="submit" class="btn btn-primary" ng-click="update(data.field, 'somename')"&gt;&lt;span class="glyphicon glyphicon-ok"&gt;&lt;/span&gt;&lt;/button&gt;
          &lt;button type="button" class="btn btn-default" ng-click="cancelEdit()"&gt;&lt;span class="glyphicon glyphicon-remove"&gt;&lt;/span&gt;&lt;/button&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>When the user saves, the <code>update</code> function is called. However, the issue I'm having is that how do I send whatever text the user inputs, towards my angular logic, without settings the text values in an object at the start of the controller?</p>
  
  <p>Heres an example:
  <a href="http://jsfiddle.net/43GUa/1/" rel="nofollow">http://jsfiddle.net/43GUa/1/</a></p>
  
  <p>Basically it prints in the console: <code>undefined + somename</code></p>
  
  <p>How do I get that <code>undefined</code> to the text in the input field? I can't use <code>ng-model</code> since I'm unable to declare my object data(?) in my controller.</p>
  
  <p>Cheers</p>