generator-angular icon indicating copy to clipboard operation
generator-angular copied to clipboard

Minsafe option places controller name in wrong place

Open noah-freitas opened this issue 13 years ago • 0 comments

Running yo angular:controller page --coffee --minsafe

Creates this:

'use strict'

angular.module('testApp')
  .controller ['$scope', 'PageCtrl', ($scope) ->
    $scope.awesomeThings = [
      'HTML5 Boilerplate',
      'AngularJS',
      'Testacular'
    ]
  ]

It should be:

'use strict'

angular.module('testApp')
  .controller 'PageCtrl', ['$scope', ($scope) ->
    $scope.awesomeThings = [
      'HTML5 Boilerplate',
      'AngularJS',
      'Testacular'
    ]
  ]

'PageCtrl' is the name of the controller being registered (not a service being injected), it should therefore be the first argument to .controller() and should appear outside of the array.

noah-freitas avatar Feb 28 '13 19:02 noah-freitas