I have an angular app using ngRoute when I declare controller normally it doesn't work correctly becault of implicit return of coffeescript so I use this solution but this time I get this error:
Error: [ng:areq] Argument 'BarsController' is not a function, got undefined
simplified version of myApp:
angule.module('app',['ngRoute'])
.config(($routeProvider)->
$routeProvider.when('/bar',
templateUrl:'bar/bars.html'
controller:'BarsController'
controllerAs:'bc'
)
)
angular.module('app').controller('BarsController',['$scope','$resource',BarsCtrl])
class BarsCtrl
constructor:($scope,$resource)->
console.log "in controller"