Is possible to get the instance reference of a Injectable angular service in a generic class? I need to not put the angular Injectable in the constructor, so I am trying to find a different approach to get the Service reference.
Example:
export class Utils {
getData(): string {
//Service reference without using the constructor
if(!isAuthorized()) return
//Do something
}
}
@Injectable({
providedIn: 'root'
})
export class AuthenticationService {
isAuthorized(): boolean {
//Do stuff
}
}