# HG changeset patch # User Lucas Thompson # Date 1487888456 0 # Node ID edddb2a5cf107559f82210eb28698f749bf6dcbc # Parent 8f2b2aed0df14f806fd8288c02521eeaa8e16916 Stop angular-cli / webpack complaining by using some factories. diff -r 8f2b2aed0df1 -r edddb2a5cf10 src/app/app.module.ts --- a/src/app/app.module.ts Thu Feb 23 22:15:52 2017 +0000 +++ b/src/app/app.module.ts Thu Feb 23 22:20:56 2017 +0000 @@ -19,6 +19,10 @@ )(); } +export function createAudioElement(): HTMLAudioElement { + return new Audio(); +} + @NgModule({ declarations: [ AppComponent, @@ -34,8 +38,8 @@ MaterialModule ], providers: [ - {provide: HTMLAudioElement, useValue: new Audio() }, // TODO use something more generic than HTMLAudioElement - {provide: 'AudioContext', useValue: createAudioContext()}, // use a string token, Safari doesn't seem to like AudioContext + {provide: HTMLAudioElement, useFactory: createAudioElement}, // TODO use something more generic than HTMLAudioElement + {provide: 'AudioContext', useFactory: createAudioContext}, // use a string token, Safari doesn't seem to like AudioContext AudioPlayerService, FeatureExtractionService, {provide: 'PiperRepoUri', useValue: 'assets/remote-plugins.json'}