Here we will learn how to create a new provider or add new services in ionic 3 applications.
This tutorial will help you to learn basics of provider.
write this command in your cli.
$ ionic g provider auth
it will generate these folders and file in your project.
open “app.module.ts” and add following lines
NullInjectorError: No provider for HttpClient!
NullInjectorError: No provider for AuthProvider!
- what is a provider – it is a ready to plug in service which can be used in application just by importing it to page.
- why we use providers – we use providers to consume REST services and to provide some data to application using some external sources.
- how to create ionic project – follow this link