I am unable to access parent object form activatedRoute in angular service, but it working fine in component. Is here any way to getting the same parent object in service.
import {ActivatedRoute} from '@angular/router'
constructor(private activatedRoute: ActivatedRoute) {}
In component:
onEdit = ({ studentId }) => {
console.log('parent ', this.activatedRoute.parent)
// getting parent object
}
In Service
onEdit = ({ studentId }) => {
console.log('parent ', this.activatedRoute.parent)
// getting null
}