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.
Step (1)
write this command in your cli.
$ ionic g provider auth
it will generate these folders and file in your project.
[adToAppearHere]
Step (2).
open “app.module.ts” and add following lines
StaticInjectorError[HttpClient]:
NullInjectorError: No provider for HttpClient!
StaticInjectorError[AuthProvider]:
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
Author Profile
- Hey Its..! Tech Lover , Ionic, Angular, Typescript, Dotnet Core, Node, Like Opencv, AI, ML, Robotics, Iot, Love Music, Cooking, Girls, Innovation
One Comment
Leave a Reply