Fireship · @fireship
Progressive Web Apps with Angular
Uploaded September 3, 2017 · Length 6:12
Summary
convert angular app to progressive web app with pwa spec and service worker
- angular pwa
- progressive web app
- service worker
- pwa spec
- offline caching
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
a progressive web app or pwa will make
- 0:03
a traditional web application behave
- 0:05
more like a native mobile app
- 0:07
in this episode we're going to take an
- 0:08
angular 4 application and make it 100
- 0:11
compliant with google's pwa spec
- 0:13
to do this we're going to create an app
- 0:15
manifest with a bunch of mobile icons
- 0:17
we're going to cache our app offline
- 0:18
with a service worker and we're going to
- 0:20
serve it over a secure https connection
- 0:23
when that's all said and done we'll be
- 0:25
able to run our app through the
- 0:26
lighthouse chrome plugin which is
- 0:28
maintained by google
- 0:29
which will tell us whether or not we're
- 0:31
meeting all the pwa requirements as well
- 0:33
as give us some feedback on performance
- 0:35
and best practices
- 0:36
not only will this provide a better user
- 0:38
experience but it will also bring up
- 0:40
this ad to home screen banner on
- 0:41
android devices or any other program
- 0:44
that supports progressive web apps
- 0:46
currently it's not supported in ios
- 0:47
safari or microsoft edge but they are
- 0:50
moving in that direction so they
- 0:51
probably will be supported in the future
- 0:53
another cool feature we're not going to
- 0:54
talk about in this video is push
- 0:56
notifications but i do have another
- 0:58
video covering that topic so make sure
- 0:59
to check that out as well
- 1:01
the first step is to install the
- 1:02
lighthouse plugin for chrome you can get
- 1:04
it in the chrome store
- 1:05
and it's what we're going to use to
- 1:07
generate the actual audit
- 1:09
on the site the next step is to create
- 1:11
the manifest.json file in the source
- 1:14
directory of your project
- 1:15
the purpose of this file is to tell
- 1:17
browsers exactly how to handle your web
- 1:19
app
- 1:20
for example your app should have a name
- 1:22
and some theme colors
- 1:24
and you'll also want to tell it whether
- 1:25
or not to display in portrait or
- 1:27
landscape then we need to generate some
- 1:29
icons there's plenty of places on the
- 1:31
internet where you can have this all
- 1:32
done automatically with just a single
- 1:34
base
- 1:34
logo you need to have a variety of icons
- 1:36
to handle different mobile devices and
- 1:38
operating systems
- 1:40
after you generate the icons drop them
- 1:42
into your assets folder in angular
- 1:44
and then add them to the manifest each
- 1:46
icon will need to have its own source
- 1:48
size and type specified that's it for
- 1:51
the manifest there's plenty of other
- 1:52
things we could add here but this is the
- 1:54
bare minimum that we need for now
- 1:56
the next thing we need to do is link our
- 1:58
manifest in the index.html as well as


