0
I have an application that makes use of the module ngRoute
.
When the url of a restricted page is accessed, I check if the user is logged in, and then allow access. Only I was replicating this routine in various parts of my code. So I thought, I’m going to encapsulate this in a service. But for my unhappiness services like factory
and service
are not accessible in the block config
of my module. So I thought I’d use the provider
.
But there it is. This is the only way to separate my checking routine or is there any form that is more trivial?
Why not use Sessionstorage or Localstorage?
– DiegoAugusto
@Diegoaugusto, the problem is that it is not accessible in the 'config' block'
– Meeeefiu