简体   繁体   中英

Angular returns $$state object - Angular and Kinvey

I have the following function:

 $scope.save = function() {       
    var promise = Kinvey.DataStore.get('books','5631713ddc168ca90f0202b6');
    console.log(promise);

Here's the console.log:

d {$$state: Object}
$$state: Object
pending: undefined
processScheduled: false
status: 1
value: Object
_acl: Object
_id: "5631713ddc168ca90f0202b6"
_kmd: Object
password: "teste"
teste: "teste"
username: "testeasdf"
__proto__: Object  

How can I get the "password", "teste" and "username" value?

Try this:

Kinvey.DataStore.get('books', '5631713ddc168ca90f0202b6', function (response) {
    console.log(response.password)
});

Or:

var promise = Kinvey.DataStore.get('books','5631713ddc168ca90f0202b6');
promise.then(function(response) {
    console.log(response.password)
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM