0
세 개의 함수가있는 팩토리를 선언했습니다. 함수를 가져 오지만 다른 두 함수는 호출 할 수 없었습니다. 컨트롤러의 기능을 호출 angularjs 팩토리에서 함수가 정의되지 않았습니다.
todomvc.factory('todoStorage', function ($q,$http) {
var STORAGE_ID = 'todos-angularjs-perf';
function get(){
return $http.get('test.json');
}
function display(){
console.log("testing");
}
function put(todos) {
console.log(todos);
return $http.get('test.json');
}
return{get:get};
return{put:put};
});
,
display(); // undefined here
todoStorage.put(todos); // undefined here too
내가 실수를하고있는 중이 야?
당신의 공장 해상력이를 wrong..check http://stackoverflow.com/questions/26906503/passing-arguments -to-factory/26906603 # 26906603 – Asik