This is not currently supported, but it is ultimately planned to add support. The initial approach using the decorator @View()was discarded (see also https://github.com/angular/angular/issues/7363 ).
You can use ngSwitchor ngIfto switch between different parts of the same template.
>=RC.2
template: `
<div [ngSwitch]="value">
<div *ngSwitchCase="phone">
phone content here
</div>
<div *ngSwitchCase="tablet">
table content here
<div *ngSwitchDefault>
brower content here
</div>
</div>
`
<=RC.1
template: `
<div [ngSwitch]="value">
<div *ngSwitchWhen="phone">
phone content here
</div>
<div *ngSwitchWhen="tablet">
table content here
<div *ngSwitchDefault>
brower content here
</div>
</div>
`
source
share