I want to push a provider to my list of providers only if browser is IE.
I tried like
const IE = detectIE();
providers: [abcService,
xyzService,
(IE) ? [{provide: EVENT_MANAGER_PLUGINS,
useClass: IeInputEventManagerService,
deps: [DOCUMENT],
multi: true
}] : [],
The above code throws AOT error saying symbols not allowed in decorator. I tried like below also
const IE = detectIE();
const tempProviders: Array<any> = [
abcService,
xyzService];
if(IE) {
tempProviders.push({provide: EVENT_MANAGER_PLUGINS,
useClass: IeInputEventManagerService,
deps: [DOCUMENT],
multi: true
});
}
@NgModule -> continues here
In above case, the provider never gets pushed or never gets active. How do i solve this issue?