1

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?

4

1 回答 1

0

尝试这个:

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

或者:

var promise = Kinvey.DataStore.get('books','5631713ddc168ca90f0202b6');
promise.then(function(response) {
    console.log(response.password)
});
于 2015-10-29T16:44:23.383 回答