Skip to content

Commit

Permalink
fix: Function calls are not supported in decorators but 'NgxPwaInstal…
Browse files Browse the repository at this point in the history
…lModule' was called
  • Loading branch information
alQlagin committed Jan 28, 2020
1 parent f5e7d2e commit 7b842eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions projects/ngx-pwa-install/src/lib/ngx-pwa-install.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { CommonModule } from '@angular/common';
import { NgxPwaInstallComponent } from './ngx-pwa-install.component';
import { BeforeInstallPrompt } from './ngx-pwa-install.providers';

export function beforeInstallPromptInitializerFactory(beforeInstallPrompt) {
const initializer = () => Promise.resolve(beforeInstallPrompt);
return initializer;
}

@NgModule({
declarations: [NgxPwaInstallComponent],
imports: [
Expand All @@ -12,9 +17,6 @@ import { BeforeInstallPrompt } from './ngx-pwa-install.providers';
})
export class NgxPwaInstallModule {
static forRoot(): ModuleWithProviders<NgxPwaInstallModule> {
const beforeInstallPromptInitializerFactory = beforeInstallPrompt => {
return () => Promise.resolve(beforeInstallPrompt);
};

return {
ngModule: NgxPwaInstallModule,
Expand Down

0 comments on commit 7b842eb

Please sign in to comment.