2016-03-10 98 views
1

我在表格(智能表)中显示我的数据,一切正常,但在我的角码中,当我尝试获取我的“topicList”时,它返回一个空数组。有我的代码,并提前谢谢你。

$scope.topicList= Restangular.all("topic").getList().$object; 
    for(var k in $scope.topicList) { 
     console.log($scope.topicList[k]); 
    if($scope.topicList[k] === "") 
     {xxxx} 
    } 

回答

0
Restangular.all('topic').getList().then(function(response) { 
    $scope.topicList = response; 
    ... 
}); 

您分配的题目列表,那么你可以做你的点点滴滴后。