title: AngularJS - Get data by ID
body: <p>I got the following situation:<br>
  I got some custom marker an a static (non google) map. I display(and filter) the marker with this code:  </p>
  
  <pre><code>&lt;div ng-controller="DealerDetailsListCtrl"&gt;
      &lt;a ng-click="showdetails=!showdetails" href="#/dealer/{{marker.id}}" class="marker" style="left:{{marker.left}};top:{{marker.top}}" ng-repeat="marker in dealer|zipFilter:zipCodeLookup:countryLookup"&gt;&lt;/a&gt;
  &lt;/div&gt;  
  </code></pre>
  
  <p>I route it to the "dealer-details.html" where I successfully display the ID:  </p>
  
  <pre><code>  &lt;div class="alldealermodal" ng-controller="DealerDetailsCtrl"&gt;      
      &lt;div ng-view&gt;&lt;/div&gt;
    &lt;/div&gt;  
  </code></pre>
  
  <p>with this controller / routing:  </p>
  
  <pre><code>app.config(['$routeProvider', function($routeProvider) {
    $routeProvider.
        when('/dealer/:id', {templateUrl: 'files/tpl/dealer-details.html', controller: DealerDetailsCtrl}).
        otherwise({redirectTo: '/'});
  }]);  
  </code></pre>
  
  <p>and  </p>
  
  <pre><code>function DealerDetailsCtrl($scope, $routeParams) {
    $scope.id = $routeParams.id;
  }  
  </code></pre>
  
  <p>Since I'm very new to angularJS I would like to know, how could I get all the data by the ID.  </p>
  
  <p>My json file looks like this:  </p>
  
  <pre><code>[
  {
      "id": "2",
  
      "name": "Laden Dortmund",
      "strasse": "Unionstr.",
      "hausnr": 1,
      "plz": "45525",
      "stadt": "Dortmund",
      "land": "DE",
      "url": "http://www.google.de",
      "tel": "0234-234568",
      "email": "lade@indortmund.de",
      "left": "200px",
      "top": "300px",
      "lowRange":60000,
      "highRange":70000
  },
  {
      "id": "1",
      "name": "Laden Unna",
      "strasse": "Berlinerstr.",
      "hausnr": 134,
      "plz": "78654",
      "stadt": "Unna",
      "land": "AT",
      "url": "http://www.bing.de",
      "tel": "0234-11223344",
      "email": "lade@inunna.de",
      "left": "250px",
      "top": "500px",
      "lowRange":40000,
      "highRange":50000
  }
  ]
  </code></pre>
  
  <p>and so on.... and I would like to get all data from the chosen id. How can I do that? Would somebody give ma a hint? </p>
  
  <p>I use this controller to get ALL the data from the json:  </p>
  
  <pre><code>function DealerListCtrl($scope, $http) {
    $scope.dealer = [];
    $http.get('files/js/dealer.json').success(function(data) {
      $scope.dealerall = data;
    });
    $scope.orderProp = 'id';
  }
  </code></pre>