<!DOCTYPE html>
<html ng-app="myapp">
<head>
<meta charset="UTF-8">
<title></title>
<script src="lib/js/angular/angular.min.js"></script>
<script>
var my = angular.module("myapp",[]);
my.controller("myCtrl",function($scope,$window,$document,$location){
$scope.gaodu = $window.innerHeight;//----高度
$scope.kuandu = $window.innerWidth;//----宽度
$scope.title = $document[0].title;//---title
$scope.xieyi = $location.protocol();//----协议
$scope.zhuji = $location.host();//---主机
$scope.duankou = $location.port();//-----端口号
$location.hash("aaa");
$scope.hash = $location.hash();//---hash部分
$scope.dizhi = $location.absUrl();
})
</script>
</head>
<body ng-controller="myCtrl">
<p>屏幕高度{{gaodu}}</p>
<p>屏幕宽度{{kuandu}}</p>
<p>页面title{{title}}</p>
<p>获取url协议{{xieyi}}</p>
<p>获取url主机{{zhuji}}</p>
<p>获取端口号{{duankou}}</p>
<p>获取hash部分{{hash}}</p>
<p>获取访问地址{{dizhi}}</p>
</body>
</html>