Angular: Empty Fiddle
http://angularjs.org/
by Leonardo Trimarchi
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<div ng-controller="MyCtrl">
<p>
Window width:{{winWidth}}px
</p>
<p>
The Url is: {{url}}
</p>
<ul>
<li>{{protocol}}</li>
<li>{{host}}</li>
<li>{{port}}</li>
</ul>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
angular.module('myApp').controller("MyCtrl", function($scope, $window, $location ){
$scope.winWidth = $window.innerWidth;
$scope.url = $location.absUrl();
$scope.protocol = $location.protocol();
$scope.host = $location.host();
$scope.port = $location.port();
});