Skip to content

puku0x/angular-pwa-sample

Repository files navigation

Actions status Dependency status Dev Dependency status Known Vulnerabilities

angular-pwa-sample

lightouse

This is a PWA sample using Angular CLI.

This sample contains following features.

  • Angular Service Worker
  • App Shell with Angular Universal

Tutorial

  1. Install Angular CLI
$ npm i -g @angular/cli
  1. Create an app
$ ng new my-app --routing --style=css
$ cd my-app
  1. Add service worker
$ ng add @angular/pwa
  1. Generate App Shell
$ ng g app-shell --project=my-app
  1. Run ng run to build the app
$ ng run my-app:app-shell

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