Created
July 28, 2019 17:44
-
-
Save arturovt/93e86f7c1bf00e2de305d1d6590cc175 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If
ButtonComponent
uses other componentsapp-foo
, how should we declare it in@NgModule
declarations?