0
我有一些屏幕,我將在這裏調用一些URL。但我知道如何使用獲取並顯示數據來調用該函數。但是現在我想用url發送參數。如何將參數傳遞給url
這裏我url.i需要發送的參數:
this.passingdata = { CatID: "2" };
這上面的參數我需要發送到以下網址獲取功能
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);
}
預先感謝!
OKAY,與我相同的代碼告訴我,我怎麼可以通過paremeter ....我們可以改變這個值'post'而不是'get' –