In my angular app I have
{ provide: QUEUE, useValue: window.events }
in my providers. I was wondering how can I set QUEUE to use an empty array [] if window.events are undefined. I tried something like this and it didn't work.
{ provide: QUEUE, useValue: window.events || [] }
Here is what I have in QUEUE.injection-token.ts
import { InjectionToken } from '@angular/core';
export const \QUEUE = new InjectionToken<Array<AppEvent>>('QUEUE');
Thanks!