I have an application that makes use of the ngRoute
module.
When the url of a restricted page is accessed, I check if the user is logged in and then allow access. But I was replicating this routine in various parts of my code. So I thought, I'm going to encapsulate this into a service. But for my unhappiness services of type factory
and service
are not accessible in block config
of my module. So I thought I'd use provider
.
But there it is. Is this the only way to separate my check routine or is there some way that is more trivial?