I managed to solve my problem as shown here
import {Component, Directive, ContentChild, TemplateRef} from 'angular2/core'; @Directive({ selector: 'card-view' }) export class CardViewComponent { @ContentChild(TemplateRef) itemTmpl; ngAfterContentInit() { console.log('In CCV', this.itemTmpl) } }
Hope this helps someone else facing a similar issue. Or maybe someone can point me to a better solution.
Update: For newer versions of ng2 (RC at the time of writing this), you will need to use forwardRef() in some cases:
@ContentChild(forwardRef(() => CardViewComponent)) cardViewComponent; @ContentChild(forwardRef(() => ListViewComponent)) listViewComponent;
source share