0

i have some screen, where i will call some url. But i know how to call the function using get and show the data.But now i want to send the parameter with url.

here my url.i need to send the parameter :

this.passingdata = { CatID: "2" };

This above parameter i need to send to below get url function

 constructor(public viewCtrl: ViewController, public modalCtrl: ModalController, private http: Http, public loadingCtrl: LoadingController) {
    let that = this
    let loader = this.loadingCtrl.create({
      content: "Please wait..."
    });
    loader.present();
    that.http.get('http://www.example.com/api/tackj.php').map((res) => res.json()).subscribe((data: any) =>{
      that.questions = data.QuestionsList;
      loader.dismiss();
    })
  }

  ionViewDidLoad() {
    let that = this;
    that.slides.lockSwipes(true);
    that.slides.enableKeyboardControl(false);
  }

Thank in advance !!

hybrid Dev
  • 529
  • 3
  • 14
  • 33

1 Answers1

0

If you want to pass some parameters most probably it would be a post method then you can pass data as second parameter to the http.post method. So you need to find out whether the API is post method or get method. Refer this link AngularJS passing data to $http.get request

Sathyajith
  • 3,836
  • 3
  • 15
  • 28
  • OKAY, with my same code tell me how can i pass paremeter....we can change that value to `post` instead of `get` – hybrid Dev May 27 '17 at 17:09