angularangular-cliangular-schematics

How to run Angular CLI commands from code


is there a way to run ng g component from code - something like on button click from UI need to run this command and component should be created.

Purpose : I have created Angular custom schematic which is used as dependency in angular application. If i run ng g schematic:home from angular application terminal it will call a Rule to create home component - but instead of running ng g schematic:home in terminal need to call schematic from angular application programmatically(from code)


Solution

  • You can't create components from any events.