0
我很好奇,爲什麼下面不工作,我以爲是我不理解的CoffeeScript:如何使用角度無級控制器的CoffeeScript「這個」:
angular.module('clientApp')
.controller 'FoobarCtrl', ($scope) ->
console.log "Foobar controller"
$scope.content = "message from foobar"
@output =() ->
return "returned message from coffee controller"
我以爲上面會相當於:
angular.module('clientApp')
.controller('FoobazCtrl', function ($scope) {
console.log("Foobar controller")
$scope.content = "message from foobar";
this.output = function(){
return("returned message from coffee controller");
}
});
但它似乎不是。誰能告訴我哪裏出了問題?
爾加,謝謝!愚蠢的我! – 2014-11-04 20:43:49