$ 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?