Warning!
Before using technique in the answer, please check this issue, which describes error Expression has changed after it was checked. Previous value: 'CD_INIT_VALUE'.
I've also provided a pretty (imo) workaround there.
Question
I wrote a popup (dialog) component, which creates a small window in the center of the screen with two buttons and close icon. I want to use this component for a few purposes: prompt, alert, confirmation, etc. So I need defferent templates be conditionally included. Am I right that the only good way is this: to include all code at once and use *ngIf? Or may be I should create one component for prompt, one for confirmation? But in second case I will get some lines of code duplicated.
Tip
You may mant to use this question in cooperation with Angular 2 @ViewChild in *ngIf