The factory method is simply called to create your service so 'this' is not relevant here, whether or not you store it as self.
What you need to do instead is simply put the object you are returning in a variable and reference that...
var service = {
...
service.login();
···
}
return service;
... sent from my tablet
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.