Now i wish to create an object that you can instanciate at any time but that can still use angular services:
Take for instance the following object:
var myObject = function (variableOne, variableTwo) {
this.variableOne = variableOne;
this.variableTwo = variableTwo
};
myObject.prototype.useAngularService = function () {
return $sessionStorage.user;
};
Ofcourse this object cannot use $sessionStorage but my question is how would you create an object like that, that actually could utilize angular services?
The reason why i want to use this method instead of a service or a factory is basicly that i want different instances of this object and i am not looking for a singleton solution.