-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
area: service-workerIssues related to the @angular/service-worker packageIssues related to the @angular/service-worker packagefreq1: lowtype: bug/fix
Milestone
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ X ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
ServiceWorkerModule.register('/ngsw-worker.js', {enabled: [boolean]});
Expected behavior
ServiceWorkerModule.register('/ngsw-worker.js', {enabled: enableServiceWorker()});
or
{provide: RegistrationOptions, useFactory: () => {enabled: enableServiceWorker()}}
This way is not possible because RegistrationOptions is not exported.
What is the motivation / use case for changing the behavior?
Export RegistrationOptions provider in order to change the implementation.
The environment variable of my app is splitted in serveral files and joined with a merge function. So AOT fails registering service worker. The solution is enable it by Dependency injection but the provider is not public.
export const environment = merge([{}, ENVIRONMENT_DEV, ENVIRONMENT_GLOBAL, { ... }]);
Environment
Angular version: 5.2.9
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: service-workerIssues related to the @angular/service-worker packageIssues related to the @angular/service-worker packagefreq1: lowtype: bug/fix