I'm storing an object inside of the service in my angular app, I can't access 'this' from within the callback method. Something like this...
app.service("myService", ['$http', '$q',
function($http, $q) {
return ({foo: foo});
this.myObj = {};
function doSomething(param, callback){
param++;
callback(param);
}
function foo(param){
doSomething(param, function(responce){
this.myObj.myParam = responce;//'this' is undefined
});
}
});
How do I access it correctly? Thank you...