error TS2416: Property 'get' in type 'ToastInjector' is not assignable to the same property in base type 'Injector'.
Type '(token: any, notFoundValue?: T, flags?: InjectFlags) => ToastPackage | T' is not assignable to type '{ (token: ProviderToken, notFoundValue: undefined, options: InjectOptions & { optional?: false; }): T; (token: ProviderToken, notFoundValue: null, options: InjectOptions): T; (token: ProviderToken<...>, notFoundValue?: T, options?: InjectOptions | InjectFlags): T; (token: ProviderToken<...>, notFou...'.
Types of parameters 'flags' and 'options' are incompatible.
Type 'InjectOptions & { optional?: false; }' is not assignable to type 'InjectFlags'.
toast-injector.ts
import {Injector, InjectFlags} from '@angular/core’;
import { ToastPackage } from './toast-config';
export class ToastRef<T> {
export class ToastInjector implements Injector {
constructor (
private _toastPck: ToastPackage,
private _parntInjtr: Injector
) {}
//eslint-disable-next-line
get<T> (token: any, notFoundValue?: T, flags?: InjectFlags): T | ToastPackage {
if (token === ToastPackage) {
return this. _toastPck;
}
return this._parntInjtr.get<T> (token, notFoundValue, flags);
}
}
The issue is coming in angular 16 after upgradation.Actual issue causing at "get". Any suggestion how to handle this get.