I am trying to figure out how to retrieve the path of the BarComponent within the code snippet below. Specifically, I need to obtain '../bar/bar.component'. When dealing with a module loaded from a package such as Component module, I would like to access "@angular/core". Is this achievable?
import { Component, OnInit } from '@angular/core';
import { BarComponent } from '../bar/bar.component';
@Component({
selector: 'app-foo',
templateUrl: './foo.component.html'
})
export class FooComponent implements OnInit {
barComponentPath;
constructor() { }
ngOnInit() {
this.barComponentPath = ""; // How can I do this?
}
}
You can find a working example here https://stackblitz.com/edit/so-question.
Your assistance is greatly appreciated.