Unfortunately, without a plunker example, it's challenging to reproduce the issue. However, I was able to successfully halt an HTTP request using your code as a reference. Check out the Plunker here
Modified Controller.js
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope, $q, $http, $timeout) {
$scope.message = 'Operation not completed';
var canceller = $q.defer();
$scope.performAction = function() {
$timeout(function() {
canceller.resolve();
$scope.message = "Action canceled";
}, 1);
$scope.message = "Action performed";
var url = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22nome%2C%20ak%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys';
var request = $http.get(url, { timeout: canceller.promise });
request.success(function(results) {
$scope.message = "Data loaded successfully";
$scope.results = results;
});
}
});
view.html
<body ng-controller="MainCtrl">
<p>Hello {{name}}!</p>
<p>{{message}}</p>
<a href="" ng-click="performAction()">Perform action</a>
<p>
{{results}}
</p>
</body>