terug naar overzicht

19/01/21

Insight insight

.NET Applicatieontwikkeling

Daan Stolp

+31 35 539 09 09


19/01/21

Add offline capabilities to your Angular app

So you want your Angular app to work offline? Great, just build a Progressive Web App (PWA)! That’s easily said, but hardly the full story. What if you have an existing online app to which you want to add offline capabilities? Or perhaps you are designing a new app that will work mostly online, but needs one or two screens to work offline as well?

The online-first strategy

The online-first strategy is the obvious choice when you have an existing application to which you want to add offline capabilities. It is also a good strategy to use when you are building a new app that only needs offline capabilities for a very limited, specific part of the app. To implement such a strategy, you essentially build your app as if it is a regular on-line only app, and then you add some magic fairy dust that will make certain parts offline-capable. So what does this magic fairy dust look like?

Retrieving data

If you want to work with data when your are offline, you obviously need to have retrieved it beforehand, when you were still online. The service worker can help with this.

Hopefully, these recipes and code examples give you some inspiration how you can add offline capabilities to your angular app.rnrnUp next: the final part of this series! In the final part we’ll look at the offline-first scenario: how can you deal with data when you are mostly offline and are only occasionally online?

Delen