title: Displaying json data in input field with AngularJS
body: <p>I would to display JSON data in html input fields using AngularJS.
  Here's the code.</p>
  
  <p>I have two HTML files. First HTML file contains a table which displays the json data. When you click in a row then it opens a modal window with a form (second HTML file).</p>
  
  <p>Here's the Code: JSON data</p>
  
  <pre><code>var examples = [
     { 'id': '1', 'fname': 'john' },
     { 'id': '2', 'fname': 'bonnie' },
     { 'id': '3', 'fname': 'joey' }
  ];
  </code></pre>
  
  <p>Here's the Code: (First HTML file)</p>
  
  <pre><code>...
  &lt;tr ng-repeat="item in examples" ng-click="open(this.item)"&gt;
     &lt;td&gt;{{ item.id }}&lt;/td&gt;
     &lt;td&gt;{{ item.fname }}&lt;/td&gt;
  &lt;/tr&gt;
  ...
  </code></pre>
  
  <p>Second HTML file:</p>
  
  <pre><code>...
      &lt;input type="text" class="form-control" placeholder="ID" id="firstVal" value=""&gt;
  ...
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>...
  $scope.open = function (item) {
     console.log(item.id);
     $("#firstVal").val(item.id);
  };
  ...
  </code></pre>
  
  <p>It doesn't insert the value "id" in the input field. How can I do this with AngularJS or jQuery?? In the console I'm getting the value of id.</p>