How to run Angular CLI commands from code

737 Views Asked by At

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)

1

There are 1 best solutions below

3
On BEST ANSWER

You can't create components from any events.