I have an AngularJS service that looks like this:
angular.module('myModule', [])
.factory('$myService', function () {
return {
getName: function () {
return 'Bill';
},
isAvailable: function () {
return true;
}
};
})
;
Is there a way to add properties? Currently, the service has function (aka $myService.isAvailable()). I'm curious, is there a way to have something like $myService.someProperty? If so, how? Or, does everything in a service have to be a function?
Thank you!
$prefix if possible, it is reserved for anything built-in from angularjs.