title: AngularJS cannot route from controller
body: <p>I am using angularJS routing like this</p>
  
  <pre><code>$routeProvider.
        when('/wall', {controller:DashboardCtrl, templateUrl:'/chutirghonta_repo/contentpanel/views/dashboard.html'}).
        when('/books', {controller:BooksCtrl, templateUrl:'/chutirghonta_repo/contentpanel/views/books.html'}).
        when('/tests', {controller:TestsCtrl, templateUrl:'/chutirghonta_repo/contentpanel/views/tests.html'}).
        when('/createbook', {controller:CreateBookCtrl, templateUrl:'/chutirghonta_repo/contentpanel/views/bookcreation.html'}).
        when('/createbookpage', {controller:CreateBookPageCtrl, templateUrl:'/chutirghonta_repo/contentpanel/views/bookpagecreation.html'}).
        otherwise({redirectTo:'/wall'});
        ;
  </code></pre>
  
  <p>Now, in one of my controllers, I have to redirect to a another route, so I am using</p>
  
  <pre><code>$scope.add = function(){
      window.location = "/testwebsite/contentpanel/#/createbook";
  }
  </code></pre>
  
  <p>The above code does not work. It takes me back to the default route, which is</p>
  
  <pre><code>window.location = "/testwebsite/contentpanel/#/wall";
  </code></pre>
  
  <p>But, amazingly, the code below works and leads me to the desired page</p>
  
  <pre><code>$scope.add = function(){
      window.open("/testwebsite/contentpanel/#/createbook");
  }
  </code></pre>
  
  <p>In my view layer, I have a html page with this code snippet</p>
  
  <pre><code>&lt;a href="#" ng-click="add()" class="btn btn-primary"&gt;Add New Book&lt;/a&gt;
  </code></pre>
  
  <p><strong>I am out of ideas. window.open works but window.location does not work.</strong></p>