I have function:
$scope.openNode = function (user) {
  var req = {
    method: 'GET',
    url: '/api/user/',
    headers: {
      'Content-Type': 'application/json'
    }
  };
  $http(req).then(function (response) {
    //smth do
  }, function () {
  });
};
I press the button this function is activated. If I poke again, then the request is repeated. How do I make the previous request canceled or ignored?
 
    