【问题标题】:Angular returns $$state object - Angular and KinveyAngular 返回 $$state 对象 - Angular 和 Kinvey
【发布时间】:2015-10-29 16:28:16
【问题描述】:

我有以下功能:

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

这是控制台日志:

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”的值?

【问题讨论】:

    标签: javascript angularjs kinvey


    【解决方案1】:

    试试这个:

    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)
    });
    

    【讨论】:

    • Tku 这么多 Michelem,第二个就像一个魅力。
    猜你喜欢
    • 2015-03-24
    • 2017-08-22
    • 2021-10-25
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    • 2018-08-25
    • 2017-08-25
    • 1970-01-01
    相关资源
    最近更新 更多