I use factory for myapp, is it possible to create a private factory in angular js.
module.factory('ParentService', function ($q, $http) { return { //public API }; }); module.factory('ChildService', function (ParentService, $sce) { var child = Object.create(ParentService); child.childMethod = function () { //extending the parent }; return child; });
I want my ParentService to be private so that the other controller does not have access to it.
source share