<html ng-app="myApp">
<head>
<title>angularjs-ajax</title>
<script type="text/javascript" src="js/angular149/angular.min.js"></script>
</head>
<body ng-controller="ctrl">
<input type="button" value="抓取页面内容" ng-click="method1()" />
<div style="border: 1px solid #ccc;width: 500px;height:400px;">{{content}}</div>
<script>
var app = angular.module('myApp',[]);
app.controller("ctrl",function($scope,$http){
$scope.method1 = function() {
$http.get("T2.action").then(function (response) {
$scope.content = response.data;
});
};
});
</script>
</body>
</html>