title: $location.path() is navigating to some other page
body: <p>I have below states defined-</p>
  
  <pre><code>.state('HomePage', {
    url: '/HomePage',
    templateUrl: 'home.html',
    controller: 'HomeCtrl'
  })
  
  .state('RegistrationHome', {
    url: '/RegisterHome',
    templateUrl: 'RegistrationHome.html',
    controller: 'RegistrationHomeCtrl'
  })
  
  .state('RegisterAdditionalInfo', {
    url: '/RegisterAdditional',
    templateUrl: 'RegistrationAdditional.html',
    controller: 'RegistrationAddCtrl'
  })
  </code></pre>
  
  <p>From home page when I click on register button, I will be navigating to registration home page using <code>$location.path('/RegisterHome');</code></p>
  
  <p>Now on registration home page I provide my email Id and username and click on continue button. After clicking on continue button it provides additional fields (Age and Gender) to be filled on the same page. On click of continue <code>$location.path('/RegisterHome/RegisterAdditionalInfo')</code> is loading the RegistrationAdditional.html. Age and Gender are present in RegistrationAdditional.html. </p>
  
  <p>Now there is one 'Cancel' button. If I click on 'Cancel' button I want to go to HomePage. On click of cancel I am calling one function in the controller and in this function I am writing 
  <code>$location.path('/HomePage');</code> for navigation. But it's not navigating to HomePage. On click of cancel it's navigating to 'RegistrationHome'. </p>
  
  <p>In url function (<code>$location.url()</code>) I tried to print the url. On click of 'cancel' , url is 'HomePage' but again url function is being called automatically and url value is getting changed to 'RegistrationHome'. I tried all possible ways like writing <code>$scope.$apply()</code> after <code>$location.path('/HomePage')</code>, using <code>$state.go('HomePage')</code> instead of <code>$location.path('/HomePage');</code> but nothing worked. Could someone plz help me on this. </p>