이 코드를 표시 alert- "내부 컨트롤러"그러나 그 후 다음 경고를 표시하지 않고 콘솔
에서 다음과 같은 오류와 함께 중지$ scope.getResultsPage가 정의되지 않았습니다.
app.controller('CategoryController',function(dataFactory,$scope,$http){
var API_URL = 'http://localhost:90/laravel_new/public';
$scope.categories = [];
alert("inside controller");
$scope.getResultsPage(1);
$scope.getResultsPage = function(pageNumber){
alert("inside method");
dataFactory.httpRequest(API_URL +'/listCategory?page='+pageNumber).then(function(data) {
alert("fetchedd...");
});
}
});
누구나이에 도움을 주시기 바랍니다. 사전에 감사
전화 $ scope.getResultspage (1); $ scope.getResultspage가 함수가 시작되기 전에 끝난 후에. –
브래킷에 몇 가지 문제가 있습니다. – Weedoze
dataFactory.httpRequest 코드를 주석으로 추가하거나 제거하고 alert ("inside method"); 당신이 작성한 함수가 당신의 dataFactory – Pravin