Last active
December 26, 2015 05:09
-
-
Save techhahn/7098587 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var newTodo = todos.add(credentials).then( | |
function(response) { | |
$scope.todos.push(response); | |
console.log(response); | |
console.log($scope.todos); | |
$scope.new_desc = ""; | |
} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add: function(credentials, savedSchema){ | |
var deferred = $q.defer(); | |
var newTodo = new Todo(credentials); | |
newTodo.$save( | |
function(response){ | |
deferred.resolve(response); | |
}, | |
function(response){ | |
deferred.reject(response); | |
} | |
) | |
console.log(newTodo) | |
return deferred.promise; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment