I have defined a factory with three functions inside it. I managed to successfully call the 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};
});
When trying to call these functions in the controller:
display(); // Returns undefined
todoStorage.put(todos); // Also returns undefined
Can someone point out where my mistake might be?