I have a resource defined for which I have defined a custom method. In my template, I am not able to hit this method. My code looks like this. The getName() function is not being called. What am I missing here
personservices.factory("Person", ["$resource", function($resource) {
var Persons = $resource("", {}, {
query: {method:'GET'}
});
Persons.prototype.getName = function () {
/* do something */
return name;
}
return Persons;
}]);
<ul>
<li ng-repeat="person in persons">
{{ person.getName() }} -> not being called
{{ person.id }}
</li>
</ul>
$scope.Persons = Person.query()
-> works perfectly
people
declaredpeople.name
?