Angular Goodness : Angular way on how to be Silent on Success of REST Request

In Angular, lets say you are making a REST call to get a List of Contacts,  but want to do nothing on the Success callback function, how will we achieve it using Angular.
The Magic lies in angular.noop() ,   to do nothing on the success callback invoke angular.noop()

//do nothing on the success callback, hence replacing the success callbck function with angular.noop()
$scope.contacts= Contacts.query( angular.noop,function(response) {
Window.myresp = response;
$scope.displayError(response);
console.log("bad boy, listContacts failed");
});
view rawnoop hosted with ❤ by GitHub

Comments

Popular posts from this blog

Apache Airflow Wait Between Tasks

Hibernate Interview Questions

Java Spring Interview Questions