调用函数包含$http.get()
$scope.storeDb = function() {
$scope.url = '/some';
$http({method: 'GET', url: $scope.url}).
success(function(data, status, headers, config) {
console.log(data);
alert(status);
}).
error(function(data, status, headers, config) {
alert('error is ' + status);
});
}
我正在调用函数ng-click
<input type="submit", value='ask', ng-click='storeDb()'/>
警报消息是error is 0