I created a JSFiddle example showcasing my Angular 4 app. However, when I attempt to inject ChangeDetectorRef
in the Child
component:
public constructor(
private _changeDetectorRef: ChangeDetectorRef) {}
An error is thrown:
Error: Can't resolve all parameters for ChildComponent: (?).
It seems I am unable to inject any service from "@angular/core". Interestingly, when I remove the constructor or ChangeDetectorRef
injection, everything functions as expected.
Does anyone have advice on how to successfully inject ChangeDetectorRef
in my component?
Appreciate any insights. Thanks!