我试图在成功回调后重定向到另一个页面但是我收到此错误 TypeError:无法读取属性' push'未定义的
this.http.post('http://localhost:3030/users', userDetails).subscribe(function
successCallback(response) {
this.navCtrl.push(HomePage);
}, function errorCallback(response) {
// response with status 500
}) ;
答案 0 :(得分:-1)
像这样使用箭头功能this.http.post('http://localhost:3030/users', userDetails).subscribe(successCallback(response) => {
this.navCtrl.push(HomePage);
}, errorCallback(response) => {
// response with status 500
}) ;
-
$ ionic cordova plugin add cordova-plugin-gyroscope
$ npm install --save @ionic-native/gyroscope