更新时间:2023-01-13 22:52:37
您只需要使用返回 MD-项承诺的函数
。看到这个普拉克:http://plnkr.co/edit/rgrZ2OM9UXckmFIHtucm?p=$p$pview
You just need to use a function that returns a promise in md-items
. See this plunk: http://plnkr.co/edit/rgrZ2OM9UXckmFIHtucm?p=preview
注意:返回从 $ HTTP
承诺将与的对象来解决具有的数据。所以,你必须做这样的事情:
NOTE: Returned promises from $http
will be resolved with an object that has the data. So you have to do something like this:
return $http.get(url).then(function(response){
return response.data.someOtherPathMaybe; // usually response.data
})