I would like this custom service(I know its not the best code) to return this JSON data but nothing is returning no matter what I try. Anyone know what I am doing wrong? I am sure it is something simple that I missed. Here is my code
1 Answer
It should be in the HTML (just AwesomeCars, not AwesomeCars.carData)
<ul class="list-group" ng-repeat="car in AwesomeCars">
and you need to inject 'carData' in the controller
chadTerm.controller('chad-midterm-controller', ['$scope', 'carData',
function($scope, carData) {
$scope.AwesomeCars = carData.cars;
}]);
carDatain your HTML. docs.angularjs.org/guide/di