I use a provider for getCountries. but get parser error why?

Dear Friends,

I am a newbie in ionic. I tried the getCountries() API method mentioned in URL: API method using providers . But I got error as

Cannot find module ‘@angular/common/http’.

I try all possible ways. But could not get that package.

Please advise a solution

Thanks

Anes

@anespa check your application package.json if you have this “@angular/http”: “5.0.3”

Dear Mark,

I have “@angular/http”: “4.0.0” in package.json, As an advise I tried to update using “npm install” command. It completed at the point with screenshot

But still show same error of “Cannot find module ‘@angular/common/http’.”

Please advise

Thanks

Anes

Are you using ionic native http?

$ ionic cordova plugin add cordova-plugin-advanced-http
$ npm install --save @ionic-native/http

with app.modules.ts

import { HttpModule} from '@angular/http';

with in imports add like this..

 imports: [
  BrowserModule,
  HttpModule,
  IonicStorageModule.forRoot(),
  IonicModule.forRoot(MyApp)
  ]

With in the services acces like this..
  import {Injectable} from '@angular/core';
  import {Http, Headers} from '@angular/http';
  import 'rxjs/add/operator/map';
  @Injectable()
  export class AppService{
    constructor(private http:Http){
      console.log('App Service Initialized...');
    }
    getOffers(data){
      var headers = new Headers();
      headers.append('Content-Type', 'application/json');
      return this.http.post('http://192.168.0.152:3000/api/offers',JSON.stringify(data), {headers: headers})
      .map(res => res.json());

    }

I hope this helps…let me know if you face any issue?