This is a PWA sample using Angular CLI.
This sample contains following features.
- Angular Service Worker
- App Shell with Angular Universal
- Install Angular CLI
$ npm i -g @angular/cli
- Create an app
$ ng new my-app --routing --style=css
$ cd my-app
- Add service worker
$ ng add @angular/pwa
- Generate App Shell
$ ng g app-shell --client-project=my-app
- Run
ng run
to build the app
$ ng run my-app:app-shell --configuration=production
Congratulations ! Your Angular application is built in dist/my-app/browser
.
You can see the app by using a static file server.
$ npx serve -s dist/my-app/browser