0
我在Angular中遇到類問題。 當我試圖創造一些類控制器,我看到這個錯誤:爲什麼@用_at_替換? (CoffeeScript)
Error: [$injector:unpr] Unknown provider: _at_$scopeProvider <- _at_$scope <- MainController
類代碼:
class MainController
constructor: (@$scope, @$log) ->
@timestamp = Date.now() - 900000
angular
.module 'app'
.controller 'MainController', MainController
結果我有這樣的:
(function() {
var MainController;
MainController = (function() {
function MainController(_at_$scope, _at_$log) {
this.$scope = _at_$scope;
this.$log = _at_$log;
this.timestamp = Date.now() - 900000;
}
return MainController;
})();
angular.module('app').controller('MainController', MainController);
}).call(this);
什麼問題?