1
저는 AngularJS를 처음 사용하고 있으며, $ http jsonp 메서드를 통해 콜백을 통해 JSON 데이터를 수신하는 앱을 작성하고 있습니다. 캐싱 매개 변수는 설정되어 있지 않지만 브라우저는 데이터를 캐시합니다. 어떻게 해결할 수 있을까요?AngularJS가 기본적으로 JSONP를 캐싱합니다.
$scope.fetch=function() {
$http({method: 'JSONP', url: 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero'})
.success(function(data) {
$scope.current = data.salutation.toLowerCase();
console.log($scope.current);
$scope.dim=$scope.current; doIt();}).error(function(data) {
$scope.current = data.salutation.toLowerCase() || "Request failed"; $scope.dim=$scope.current;});
}};
.. $의 scope.fetch을 = 함수() { $ HTTP ({방법 'JSONP' , url : 'http://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero'}).success(function(data) {$ scope.current = data.salutation.toLowerCase(); console.log $ scope.current = data.salutation.toLowerCase() || "요청 실패"; $ scope.current = data.salutation.toLowerCase() || $ scope.dim = $ scope.current;}); }; – davitp
올바른 형식으로 만들 수 있도록 귀하의 질문에 넣으세요. – Travis
질문을 변경했습니다 ... 캐싱이 활성화 된 이유를 여전히 이해하지 못합니까? – davitp