Skip to content

Instantly share code, notes, and snippets.

@arturovt
Created July 28, 2019 17:44
Show Gist options
  • Save arturovt/93e86f7c1bf00e2de305d1d6590cc175 to your computer and use it in GitHub Desktop.
Save arturovt/93e86f7c1bf00e2de305d1d6590cc175 to your computer and use it in GitHub Desktop.
import {
Component,
ɵrenderComponent as renderComponent,
Injector,
ɵLifecycleHooksFeature as LifecycleHooksFeature
} from '@angular/core';
@Component({
selector: 'app-root',
template: `
<app-button></app-button>
`
})
export class AppComponent {
constructor(injector: Injector) {
import('./button.component').then(({ ButtonComponent }) => {
renderComponent(ButtonComponent, {
injector,
hostFeatures: [LifecycleHooksFeature]
});
});
}
}
@xiaoxiangmoe
Copy link

If ButtonComponent uses other components app-foo, how should we declare it in @NgModule declarations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment