$http 服务, 是 AngularJS 中的一个核心服务,用于读取远程服务器的数据。 服务向服务器发送请求,应用响应服务器传送过来的数据。
app.controller('myCtrl', function($scope, $http) {
$http.get("welcome.htm").then(function (response) {
$scope.myWelcome = response.data;
});
});
app.controller('myCtrl', function($scope, $http) {
$http.get("welcome.htm").then(function (response) {
$scope.myWelcome = response.data;
});
});