xplat icon indicating copy to clipboard operation
xplat copied to clipboard

Add guard to core lib

Open axel-zarate opened this issue 6 years ago • 2 comments

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.

axel-zarate avatar May 29 '19 16:05 axel-zarate

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.

axel-zarate avatar May 29 '19 17:05 axel-zarate

Thanks for mentioning this @axel-zarate - we'll add guard into a patch 8.0.x update.

NathanWalker avatar Jul 29 '19 15:07 NathanWalker