I am pretty new to AngularJS and Coding but I have had some guidance on this but my http.get is not returning any data. I have the following factory and controller embedded in a .js file. and have a corresponding 'ng-repeat' in a html file which I am looking to return the date from a JSON file. When I look at the details within the scope of Chrome Developer Tools it is showing the scope as being returned but had the following
{ member: null }
Factory and Controller code is as follows
app.factory('MemberFactory', ['$http' , function($http)
{
var api =
{
getMembers : function()
{
return $http.get('../json/members2.json')
},
getMembers : function(membernumber)
{ // NEW
return $http.get('../json/' + membernumber + '.json')
}
}
return api
}])
app.controller('homeController',
['$scope', '$location', '$routeParams', 'GetTheMember',
function($scope, $location, $routeParams, GetTheMember) {
GetTheMember.getmembers($routeParams.membernumber)
.success(function(data) {
$scope.member = data
})
.error(function(err) {
$location.path('./404')
})
$scope.setImage = function(img) {
$scope.img = img
}
}])
getMember.