title: Angular.js Controller can't set properties
body: <p>I'm using a clone of <a href="https://github.com/angular/angular-seed" rel="noreferrer">https://github.com/angular/angular-seed</a> to make a simple Angular.js app. I'm trying to put in some properties to the controllers in order to bind them in my HTML but keep getting errors messages that I can't seem to figure out.</p>
  
  <p>My controllers.js file looks like this currently:</p>
  
  <pre><code>'use strict';
  
  /* Controllers */
  
  angular.module('myApp.controllers', []).
    controller('MyCtrl1', [function($scope) {
      $scope.names = 'bob'
    }])
    .controller('MyCtrl2', [function() {
  
    }]); 
  </code></pre>
  
  <p>Here is the app.js too if it helps:</p>
  
  <pre><code>'use strict';
  
  // Declare app level module which depends on filters, and services
  angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives',     'myApp.controllers']).
    config(['$routeProvider', function($routeProvider) {
      $routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller:  'MyCtrl1'});
      $routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: 'MyCtrl2'});
      $routeProvider.otherwise({redirectTo: '/view1'});
    }]);
  </code></pre>
  
  <p>I've used the default name for the app "myApp" and have also called the ng-view within my HTML. When MyCtrl1 is in use I continually get this error:</p>
  
  <pre><code>TypeError: Cannot set property 'names' of undefined
  </code></pre>
  
  <p>Is there something syntactically wrong here? I've tried to only modify controllers.js to avoid having issues so there shouldn't be problems elsewhere...</p>