title: route provider how to pass a dependency into a controller
body: <p>if I have the following angularjs code route provider how can I pass through a dependency into the blaCtrl controller please?</p>
  
  <p>Many thanks,</p>
  
  <pre><code>app.config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('/bla', { templateUrl: 'bla.html', controller: 'blaCtrl' });
  </code></pre>
  
  <p><strong>trying to get something like</strong></p>
  
  <pre><code>'use strict';
  app.controller('blaCtrl', function ($scope) {
  
      $scope.mydata = ['111', '222', '333'];  // how can I change this to be a method call to a dependency, i.e.
      $scope.mydata = mydependency.getData();  // example what I need
  </code></pre>
  
  <p>});</p>
  
  <p><strong>update</strong></p>
  
  <p>My app file looks like this - I'm still not getting the data displayed?</p>
  
  <pre><code>'use strict';
  var app = angular.module('myApp', ['ngRoute']);
  
  app.config(['$routeProvider', function($routeProvider) {    
    $routeProvider.when('/application', { templateUrl: 'partials/application.html', controller: 'myCtrl' });
    $routeProvider.otherwise({ redirectTo: '/application' });
  }]);
  </code></pre>
  
  <p><strong>controller</strong></p>
  
  <pre><code>'use strict';
  
  app.controller('myCtrl', 'myService', function ($scope, myService) {
      debugger;  // doesn't get hit?
      $scope.stuff = myService.getStuff();
  });
  </code></pre>
  
  <p><strong>console error</strong></p>
  
  <pre><code>  - I get this error in the console Error: [ng:areq] http://errors.angularjs.org/1.4.5/ng/areq?p0=applicationCtrl&amp;p1=not%20a%20function%2C%20got%20string
  </code></pre>