1
변수를 보내려면 년, 월 컨트롤러에서 각도 서비스 기능을 사용 하시겠습니까?변수 보내기가 각도 서비스를 어떻게 수행합니까?
서비스
myApp.factory('getJsonForCalendarService', function($resource, year, monthGet) {
return $resource(
'../rest/api.php',
{ method: 'getJsonForCalendar', year: year, monthGet:month},
{'query': { method: 'GET', isArray: true }}
);
});
컨트롤러 귀하의 공장 기능은 오직 인스턴스화
$scope.getJsonForCalendar = getJsonForCalendarService.query(function (response, year, monthGet) {
});