title: Parsing JSON with angularjs with chosen select option
body: <p>I have two urls where I call two json objects.</p>
  
  <p>authors.json</p>
  
  <pre><code>[
      {
      "id":"1",
      "name":"Dan Brown",
      },
      {
      "id":"2",
      "name":"Steve Gates",
      }
  ]
  </code></pre>
  
  <p>books.js</p>
  
  <pre><code>[
      {
      "id":"1",
      "author_id":"1",
      "bookname":"Advance Programming"
      },
      {
      "id":"2",
      "author_id":"1",
      "bookname":"Advanced Programming"
      },
      {
      "id":"3",
      "author_id":"1",
      "bookname":"C++ involved beyond 1"
      },
      {
      "id":"4",
      "author_id":"1",
      "bookname":"C++ involved beyond 2"
      },
      {
      "id":"5",
      "author_id":"2",
      "bookname":"C++ involved beyond 3"
      },
      {
      "id":"6",
      "author_id":"2",
      "bookname":"Java involved beyond"
      }
  ]
  </code></pre>
  
  <p>What I am trying to achieve is to display a list of all books for chosen author from selected dropdown.</p>
  
  <p>So far my HTML looks something like this.</p>
  
  <pre><code>&lt;div ng-controller="authorSelectController"&gt;
      &lt;select class="form-control" id="authors" ng-model="selectedAuthor"&gt;
          &lt;option value="0" selected="selected"&gt;- Select Author -&lt;/option&gt; 
          &lt;option ng-repeat="author in authors" value="{{author.id}}"&gt;{{author.name}}&lt;/option&gt;
      &lt;/select&gt;
  
      &lt;div ng-model="showBooks"&gt;
          //Show a list of books here
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>my JS controller.js</p>
  
  <pre><code>var myApp = angular.module('myApp', []);
  
  myApp.controller('authorSelectController', ['$scope', '$http', function($scope, $http) {
      $http.get('../assets/js/data/authors.json').success(function(data) {
          $scope.authors = data;
      });
  }]);
  </code></pre>
  
  <p>Currently the authors get populate from the json, however I am unsure how to proceed from here to achieve what I want to do.</p>
  
  <p>Thank you for reading.</p>