Angular returns $$state 对象 - Angular 和 Kinvey
Angular returns $$state object - Angular and Kinvey
我有以下功能:
$scope.save = function() {
var promise = Kinvey.DataStore.get('books','5631713ddc168ca90f0202b6');
console.log(promise);
这是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
如何获取 "password"、"teste" 和 "username" 值?
试试这个:
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)
});
我有以下功能:
$scope.save = function() {
var promise = Kinvey.DataStore.get('books','5631713ddc168ca90f0202b6');
console.log(promise);
这是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
如何获取 "password"、"teste" 和 "username" 值?
试试这个:
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)
});