nstudio / xplat

Cross-platform (xplat) tools for Nx workspaces.
MIT License
369 stars 52 forks source link

Add guard to core lib #126

Open axel-zarate opened 5 years ago

axel-zarate commented 5 years ago

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 commented 5 years ago

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.

NathanWalker commented 5 years ago

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