I would like to provide default content that will only appear if the content is not broadcast.
For example, here is my component template:
<article> <header> <ng-content select="[header]"></ng-content> </header> <section> <ng-content></ng-content> </section> </article>
I can use it like this:
<my-component> <h1 header>This is my header</h1> <p>This is my content</p> </my-component>
Now, if I would like to provide a default header. Is it possible; without acrobatics, for example, checking the contents in ngAfterContentInit ?
angular
dovidweisz
source share