How can I add component dynamically?
toolbar.component.ts:
@Component({
selector: \'app-toolbar\',
template: \'
I have another way of doing it, please check for you case
html
.ts
import { COMPONENT } from './..dir../component'
OR
html
.ts
import { COMPONENT } from './..dir../component'
option = {
component: COMPONENT
}
OR if it is Dynamic, add the component to entryComponent
app.module.ts
import { COMPONENT } from './..dir../component'
@NgModule({
declarations: [COMPONENT],
/.
..
..
./
entryComponents: [COMPONENT]
});
html
.ts
/** The COMPONENT is not imported since it is added to entrycomponent**/
@Input() option;