xplat
xplat copied to clipboard
Add guard to core lib
When trying to add a guard to the shared cored lib using ng g guard auth I get an error:
Schematic input does not validate against the Schema: {"implements":["CanActivate"],"name":"auth","project":null}
It seems I am supposed to specify a project to add the guard to, but I mean for this guard to be declared in the shared core module.
On the other hand, using ng g service auth works just fine and adds the service to libs/core/services as expected.
I was able to add the guard to the desired location using ng g guard ../core/services/auth --project=libs (it seems a little hacky).
However, unlike the ng g service counterpart, it was not added to the libs/core/services/index.ts barrel.
Thanks for mentioning this @axel-zarate - we'll add guard into a patch 8.0.x update.