title: Angularjs $routeProvider not instanciate controller if not using template
body: <p>Im new to angular and Im using version 1.2.9. I found an example of routing and try to adapt it to my needs.</p>
  
  <p>The thing is I don't need to use any template <strong>I juste want the route to call my controller.</strong> To use angular to do <strong>only the routing</strong> of some part of the app.</p>
  
  <p><em>Then in the controller I will do some Ajax call to load some data.</em> </p>
  
  <p>I know that is probably not the best solution but the project started without Angular and we are implementing it now and don't want to restart from scratch.</p>
  
  <p>The problem is that if I don't call any template the controller is not called.
  I know I can call the controller in the tag eg:  <code>&lt;div ng-controller="..."&gt;</code> but is it the good solution ?</p>
  
  <p>Thank you</p>
  
  <p>So I have my <code>app.js</code></p>
  
  <pre><code>var sampleApp = angular.module('sampleApp', ['ngRoute']);
      sampleApp.config(['$routeProvider',
        function($routeProvider) {
          $routeProvider.
            when('/AddNewOrder', {
              templateUrl: 'templates/add_order.html',
              controller: 'AddOrderController' //this controller is being called.
          }).
            when('/ShowOrders', {
              controller: 'ShowOrdersController'//this controller is never called.
            }).
            otherwise({
              redirectTo: '/AddNewOrder'
            });
      }]);
  
  
      sampleApp.controller('AddOrderController', function($scope) {
          console.log("AddOrderController") 
          $scope.message = 'This is Add new order screen';
  
      });
  
      sampleApp.controller('ShowOrdersController', function($scope) {
        console.log("ShowOrdersController")
          $scope.message = 'This is Show orders screen';
  
      });
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;body ng-app="sampleApp"&gt;
          &lt;ul class="nav"&gt;
              &lt;li&gt;&lt;a href="#AddNewOrder"&gt; Add New Order &lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#ShowOrders"&gt; Show Order &lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
          &lt;div class="col-md-9"&gt;
              &lt;div ng-view&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;script src="./angular-lib/angular.js"&gt;&lt;/script&gt;
          &lt;script src="./angular-lib/angular-route.js"&gt;&lt;/script&gt;
          &lt;script src="./app.js"&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>template</p>
  
  <pre><code>&lt;h2&gt;Add New Order&lt;/h2&gt;
  
  {{ message }}
  </code></pre>