depending on the value of a (boolean) class variable I would like my ng-content
to either be wrapped in a div or to not be wrapped in div (I.e. the div should not even be in the DOM) ... Whats the best way to go about this ? I have a Plunker that tries to do this, in what I assumed was the most obvious way, using ngIf .. but it's not working... It displays content only for one of the boolean values but not the other
kindly assist Thank you!
http://plnkr.co/edit/omqLK0mKUIzqkkR3lQh8
@Component({
selector: 'my-component',
template: `
<div *ngIf="insideRedDiv" style="display: inline; border: 1px red solid">
<ng-content *ngIf="insideRedDiv" ></ng-content>
</div>
<ng-content *ngIf="!insideRedDiv"></ng-content>
`,
})
export class MyComponent {
insideRedDiv: boolean = true;
}
@Component({
template: `
<my-component> ... "Here is the Content" ... </my-component>
`
})
export class App {}