You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add PWA support so users can use the application offline and install it.
Describe the solution you'd like
Use @angular/pwapackage
run npm install @angular/pwa firstly as it's a nx workspace
run npx nx g @angular/pwa:ng-add --project=angular-hub to run the schematic
Update created icons
You can use this image here as a starter
There are multiples web app to generate different icons based one it, like PWA Builder
Add update mechanism
Add some logic to reload the application on updates, for example:
router.events.pipe(filter((event)=>eventinstanceofNavigationEnd),switchMap(()=>this.swUpdate.versionUpdates),filter((evt): evt is VersionReadyEvent=>evt.type==='VERSION_READY')).subscribe(()=>{document.location.reload();});```
### Describealternativesyou've considered
_No response_
The text was updated successfully, but these errors were encountered:
I made a quick attempt: Besides the explanation provided, it might need some extra configuration as the ngsw.json(and the generated ngsw-worker.js) were not part of the dist folder by building the application.
Installation works but by opening it it first fails as it's trying to query the angular-hub.com/assets URl for some unknown reason. By refreshing, the installed app works as expected (but it means it can't be used offline for the moment).
Relevant Scope
angular application
Description
Add PWA support so users can use the application offline and install it.
Describe the solution you'd like
Use
@angular/pwa
packagenpm install @angular/pwa
firstly as it's a nx workspacenpx nx g @angular/pwa:ng-add --project=angular-hub
to run the schematicUpdate created icons
You can use this image here as a starter
There are multiples web app to generate different icons based one it, like PWA Builder
Add update mechanism
Add some logic to reload the application on updates, for example:
The text was updated successfully, but these errors were encountered: