I have declared a factory with three functions in it. I was able to call get function but not the other two.
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};
});
Calling the functions in controller,
display(); // undefined here
todoStorage.put(todos); // undefined here too
Where I am doing a mistake?