How to use Ionic Route Guards and Resolver [v4]

ionic-guards-resolver-angular

With Ionic 4 and the closer Angular integration we can now finally enjoy the benefits from using the Router and other functions you might already know from Angular directly inside our Ionic app.

In this Quick Win we will use Route Guards to protect certain routes of your application and also a Resolver which can perform operations before we actually enter a new page to provide all necessary information upfront.

In the end we will have a dummy app to test our functionality by making requests to the PokeAPI and use the loading and alert controller of Ionic 4!


ionic-academy-start

You must be a Member to view this Quick Win

Access all courses and lessons, track your progress, connect with Developers & build awesome Ionic Apps.

Read Next..

How to Open PDF Files with Ionic 4 on Android and iOS When you want to open files inside your Ionic app you'll most likely have to interact with the local filesystem in some way - something that's not alw...
Add Social Sharing to Your Ionic App If you can let your users share the content of your app you have a greater chance of creating a buzz or viral app. The good thing is adding this funct...
Passing Data to Ionic Modals, Pages & Popover Every Ionic app consist of different pages and a solid navigation is crucial for your app. With Ionic 4 the routing changed to the standard Angular ro...

Read Next..

How to Use Font Awesome With Ionic 4 The built in Ionicons with Ionic are great, but if you need something specific, have your own custom icons or anything that's not covered by the stand...
How to Display Ionic 4 Local Notifications (Schedule, Payload & Callback) When you need a quick and easy way to notify your users about things happening in your app at a later point you can use local notifications which look...
How to Log Better in Your Ionic App With ngx-logger We have all used the good old console.log many times before, but when you are serious about building a big app especially in the enterprise context lo...