Can't select json and view it in angular unless i edit json
I want to access json in the same format:
{"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
]}
script:
phonecatApp.controller('PhoneListCtrl', ['$scope', '$http', function($scope, $http) {
$http.get('employees/employees.json').success(function(data) {
$scope.resources = data;
});
if i remove "employees" so its attributes inside [] will get my data. but if left as an example above, I cannot reach my data.
Any help is appreciated.
+3
source to share