2016-03-10 97 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; 
    ... 
}); 

您分配的題目列表,那麼你可以做你的點點滴滴後。