<!DOCTYPE html>
<html lang="en" ng-app="myapp">
<head>
<meta charset="utf-8">
<script src="js/angular.js"></script>
</head>
<body>
<div ng-controller="myctrl">
{{myWelcome}}
</div>
</body>
<script type="text/javascript">
var app = angular.module("myapp",[]);
app.controller('myctrl', function($scope, $http) {
$http.get("xxxxxx").then(function (response) {
$scope.myWelcome = response.data;
});
});
</script>
</html>
15-service之$http
最新推荐文章于 2022-08-18 19:42:21 发布