53
rated 0 times
[
58]
[
5]
/ answers: 1 / hits: 21159
/ 12 Years ago, thu, february 21, 2013, 12:00:00
I have a service
app.service('myService', function() {
this.list = [];
this.execute = function() {
//this.list is reachable here
angular.forEach(AnArrayHere, function(val, key) {
//this.list is not reachable here
});
}
}
even in controller its accessible
function Ctrl($scope, myService) {
$scope.list = myService.list;
}
Can someone explain me why this.list is not reachable within the angular.foreach and how can I access to this.list ?
More From » foreach