|
@@ -8,8 +8,9 @@ ionic g provider [providername]
|
8
|
8
|
|
9
|
9
|
This will create a `providers/[providername]/[providername].ts` file. In that file you will make the call to your server. You can read [Accessing Rest With Angular](https://medium.com/codingthesmartway-com-blog/angular-4-3-httpclient-accessing-rest-web-services-with-angular-2305b8fd654b) blog post to learn more. In this case, I added a provider called `api`.
|
10
|
10
|
|
11
|
|
-In `src/app/app.module.ts`, I added `import { HttpClientModule } from '@angular/common/http';` to the import statement up top.
|
12
|
|
-Then in the `imports` section, I added `HttpClientModule`.
|
|
11
|
+In `src/app/app.module.ts`, I did the following:
|
|
12
|
+1. `import { HttpClientModule } from '@angular/common/http';` to the import statement up top.
|
|
13
|
+2. In the `imports` section, I added `HttpClientModule`.
|
13
|
14
|
|
14
|
15
|
In `src/pages/home/home.ts`, I did the following:
|
15
|
16
|
1. added `import { ApiProvider } from './../../providers/api/api';` on the top of the file
|