I recently built a basic Angular service and encountered an issue.
@Injectable()
export class someHandler {
constructor(
public anotherService: anotherService,
) {}
...
The problem arises when I try to use this service in a component, as it consistently throws an error stating
NullInjectorError: No provider for anotherService
. However, I am unable to include providers: []
within the service itself. Any suggestions on how to resolve this issue would be greatly appreciated. Thank you!