running ionic generate page inside NX monorepo angular

Viewed 579

i am inside a NX monorepo, its working on angular.

I have installed Ionic as pre instructions given on link. Ionic is working ok, But i cant use commands like ionic generate page --project=sales-app, i am getting error like, An unhandled exception occurred: Schematic "page" not found in collection "@nrwl/angular".

Please help, how to resolve this.

2 Answers

the schematic that you should use is @ionic/angular-toolkit:page, however this require alway a module where register routes of the page

With Nx, I have not made it work and the option --skipImport not work fine in this schematics. But if you have a module correctly then run:

> npx nx g @ionic/angular-toolkit:page home --project=app1 --dry-run

Remember --dry-run its only for dump tests

Regards :)

I wanted to add a comment in @Caxvalencia answer but since I don't have enough reputation here is an answer.

You can create a page directly with a module and routing module using the --routing option

npx nx g @ionic/angular-toolkit:page home --routing --project=app1 -dry-run  
Related