fix(service-worker): allow disabling SW while still using services

Currently, the way to not use the SW is to not install its module.
However, this means that you can't inject any of its services.

This change adds a ServiceWorkerModule.disabled() MWP, that still
registers all of the right providers but acts as if the browser does
not support Service Workers.
This commit is contained in:
Alex Rickabaugh
2017-11-30 13:16:37 -08:00
parent 445d833b5d
commit f99335bc47
2 changed files with 25 additions and 11 deletions

View File

@ -1,6 +1,9 @@
/** @experimental */
export declare class ServiceWorkerModule {
static register(script: string, opts?: RegistrationOptions): ModuleWithProviders;
static register(script: string, opts?: {
scope?: string;
enabled?: boolean;
}): ModuleWithProviders;
}
/** @experimental */