How to get data from {$$state: Object}?

后端 未结 3 1380
南方客
南方客 2021-01-19 08:11

I try to get data from database using factory. I have a problem, because I don\'t know how to get data from object which was returned from factory. This is what I received

3条回答
  •  执笔经年
    2021-01-19 08:57

    It's returning a promise, and you need to handle it this way

    In your controller add this:

    getSomething.getBla().then(function(response) {
    
        console.log(response.data)
    
    });
    

    for more information: 'http://andyshora.com/promises-angularjs-explained-as-cartoon.html'

提交回复
热议问题