100
rated 0 times
[
103]
[
3]
/ answers: 1 / hits: 87763
/ 8 Years ago, sat, january 30, 2016, 12:00:00
Suppose I have a component:
@Component({
selector: 'MyContainer',
template: `
<div class=container>
<!-- some html skipped -->
<ng-content></ng-content>
<span *ngIf=????>Display this if ng-content is empty!</span>
<!-- some html skipped -->
</div>`
})
export class MyContainer {
}
Now, I would like to display some default content if <ng-content>
for this component is empty. Is there an easy way to do this without accessing the DOM directly?
More From » angular