Services not exposed beyond their's modules, private services?

237 views
Skip to first unread message

Witold Szczerba

unread,
Jul 14, 2012, 10:51:21 AM7/14/12
to ang...@googlegroups.com
Hi,
is that possible to define an 'internal' service which is injectable
everywhere inside it's module, but is not visible from outside?

Thanks,
Witold Szczerba

Witold Szczerba

unread,
Jul 22, 2012, 7:54:26 AM7/22/12
to ang...@googlegroups.com
Thanks, I will try that!

On 14 July 2012 16:57, Andy Joslin <andyt...@gmail.com> wrote:
> You could just make the service in it's own module:
>
> angular.module('myService', []).factory('myService', function(){ ... });
>
> And then inject in the module(s) you want it in:
>
> angular.module('myModuleThatUsesMyService', ['myService']);
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/angular/-/Yx5GsKYDmk0J.
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
> angular+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/angular?hl=en.
Reply all
Reply to author
Forward
0 new messages