<div ng-app="myApp" ng-controller="myCtrl">
<p> 当前页面的url:</p>
<h3>{{myUrl}}</h3>
</div>
<script>
var app = angular.module(‘myApp‘, []);
app.controller(‘myCtrl‘, function($scope, $location) {
???$scope.myUrl = $location.absUrl();
});
</script>
获取当前的url地址
原文地址:https://www.cnblogs.com/xinweiqu/p/8241860.html