how to generate components programmatically instead of giving ng generate component?

generate components programmatically from server/any ts, instead of giving ng generate component command.
I am trying to generate new component programmatically, but found solution of creating dynamic components which will not produce new files like component.html,components.ts and so on.
I wanted to have a component that should generate new component and make entry in app.module.ts.

Source: New feed
Source Url how to generate components programmatically instead of giving ng generate component?