The $location service in Angular.js parses the current browser URL and makes it available to your application. Changes in either the browser address bar or the
$location service will be kept in sync.
Depending on the configuration, the
$location service behaves differently and has different requirements for your application. We will first look into client-side routing with hashbang URLs since it is the default mode, and then later, look at the new HTML5-based routing.