-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathangular-$http-cache.html
More file actions
23 lines (23 loc) · 967 Bytes
/
angular-$http-cache.html
File metadata and controls
23 lines (23 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>angular-$http-cache</title>
<script type="text/javascript" src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="app" ng-controller="MyController">
<h2>启用缓存</h2>
<button type="button" name="button" ng-click="send()">Send</button>
<div ng-bind="name"></div>
<script type="text/javascript">
var app = angular.module('app', []);
app.controller('MyController', ['$scope', '$http', function($scope, $http){
$scope.send = function(){
$http.get('https://hq.tigerbrokers.com/fundamental/finance_calendar/getType/2017-02-26/2017-06-10', {cache: true}).then(function(data){
console.log(data);
});
};
}]);
</script>
</body>
</html>