I have two function in factory
here is some code
.factory('getArticles', function ($http, $q) {
return {
abc : function() {
var deferred = $q.defer();
// my code
res= this. bcd();
console.log(res); // undefined
deferred.resolve(res);
return deferred.promise;
},
bcd: function() {
//some codee
return res;
}
}
});
Now from controller i am calling abc function but when i checked value of res under logs. this is showing undefined.
Any idea ? how to do this ?
Thanks