I'm trying to make a class that is built into JavaScript, injectable in an Angular 2 app. For my particular use case I am trying to inject an instance of AudioContext. I've tried making it injectable the following 4 ways but none of them work
@NgModule({
providers: [
AudioContext
//{provide: AudioContext, useClass: AudioContext}
//{provide: AudioContext, useValue: new AudioContext()}
//{provide: AudioContext, useFactory: () => new AudioContext()}
]
})
export class AppModule {
}
I get the error
Error encountered resolving symbol values statically. Could not resolve type AudioContext (position 13:39 in the original .ts file)
How can I make an instance of AudioContext
injectable across my application without wrapping it in a custom service?