How, Why, and When to Use Providers in Ionic 2




By Josh Morony

Providers allow you to create a self-contained service that provides some kind of functionality to your application. The role of a provider might include things like fetching data from a server, performing operations on data, sharing data, providing a set of complicated mathematical operations, and so on.

In general, we use providers to do the heavy lifting in our applications. By using a provider, we abstract the functionality it provides away from a specific component, which makes the codebase more maintainable and allows us to reuse that same provider in multiple different places in the application (or even in a completely different application).

In this video tutorial, I walk through a simple of example of when it would make sense to create a provider and how to do it.

Read the full articles...

Share on Google Plus

About www. codeandyou.com

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment