location

How does $location work?

by Blueprinter

HTML

<button ng-click='urlLoc()'>url</button>

JavaScript

var testApp = angular.module('testApp', [
  'testControllers'
]);

testApp.controller('nameOfTestController', $scope.urlLoc = function($scope, $location) {
    var theURL = $location.url();
    alert('the URL: ' + theURL);
});