Say I have the following markup:
Is there any way I can access the component instance
Your directive could be the generic one that can be applied to any of your components. So, in that case, injecting the component in constructor would not be possible, So here is one other way to do the same
Inject the ViewContainerRef
in constructor
constructor(private _viewContainerRef: ViewContainerRef) { }
and then get it using
let hostComponent = this._viewContainerRef["_data"].componentView.component;