title: AngularJS routing keeps redirecting back to itself like it's in a loop
body: <p>I have</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" data-ng-app="myCustomApp"&gt;
      &lt;body&gt;
          &lt;div id="body"&gt;
  
             &lt;div ng-view&gt;&lt;/div&gt;
  
          &lt;/div&gt;
  
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="/Js/app.js"&gt;&lt;/script&gt;
      &lt;script src="/Js/controllers/controllers.js"&gt;&lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>With the following</p>
  
  <pre><code>app.controller('SearchController', function ($scope) {
      init();
      function init() {
          alert("called");
      }
  });
  </code></pre>
  
  <p>and the app declared like below:</p>
  
  <pre><code>var app = angular.module('myCustomApp', []);
  
      app.config(function($routeProvider) {
          $routeProvider
              .when('/search',
                  {
                      controller: 'SearchController',
                      templateUrl: '/js/partials/Search.html'
                  })
              .otherwise({ redirectTo: '/search' });
  
      });
  </code></pre>
  
  <p>The problem is that the page when browsing to the following it keeps refreshing the page like it's in a loop. Any ideas? </p>
  
  <p>/#/search</p>