I want to retrieve an object that stored in parse platform and I'm using ionic framework. so I wrote this code in Home.ts :
export class HomePage {
result: string = 'sample' ;
constructor(public navCtrl: NavController) {
Parse.serverURL = 'https://parseapi.back4app.com/';
Parse.initialize("MY_APP_ID", "MY_JS_KEY");
var GameScore = Parse.Object.extend("GameScore");
var query = new Parse.Query(GameScore);
query.get("wN9bVUA9Hu", {
success: function(gameScore) {
// The object was retrieved successfully.
this.result = gameScore.get("score").toString();
console.log(this.result);
},
error: function(object, error) {
// The object was not retrieved successfully.
// error is a Parse.Error with an error code and message.
}
});
}
}
and object's id is = wN9bVUA9Hu, so that should retrieve the object's score which is 9. but as you see here : result
result didn't change in Home.html but in the console, it is 9.
here is my Home.html code :
<ion-header>
<ion-navbar>
<ion-title>
Ionic Blank
</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<h4>{{result}}</h4>
</ion-content>
how can I solve this and show the retrieved object in Home.html ?
thanks.