1
getTopicContent.request().finally(function(){
$scope.loader= false;
}).then(function(response){
$scope.threadContent = response.data;
})
$scope.loadPages = function($scope) {
console.log($scope.threadContent.totalPages);
}
它返回undefined的threadContent。 getTopicContent是服務,但我希望$ scope.threadContent可以與$ scope.loadPages函數共享?
我得到了一個未定義的代碼不是函數錯誤。 – mike19911 2014-12-06 08:38:35
對不起,錯字。它應該是'getContent()。然後'。在答案中更新了代碼。 – dfsq 2014-12-06 08:39:39
你建議的流程和概念是有意義的,但我想知道它爲什麼說未定義的功能。 – mike19911 2014-12-06 08:40:03