Created
July 28, 2019 17:50
-
-
Save arturovt/dbf08aecef34a3b3edd2b9683e5b6c3c 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, | |
ɵmarkDirty as markDirty | |
} from '@angular/core'; | |
@Component({ | |
selector: 'app-root', | |
template: ` | |
<app-button></app-button> | |
` | |
}) | |
export class AppComponent { | |
constructor(injector: Injector) { | |
import('./button.component').then(({ ButtonComponent }) => { | |
const buttonComponent = renderComponent(ButtonComponent, { | |
injector, | |
hostFeatures: [LifecycleHooksFeature] | |
}); | |
buttonComponent.text = 'Click me'; | |
markDirty(buttonComponent); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment