Error: Argument is not a function, got undefined

前端 未结 17 1908
不思量自难忘°
不思量自难忘° 2020-12-07 19:35

Using AngularJS with Scala Play, I\'m getting this error.

Error: Argument \'MainCtrl\' is not a function, got undefined

I\'m try

17条回答
  •  广开言路
    2020-12-07 20:01

    I had the same error with a big mistake:

    appFormid.controller('TreeEditStepControlsCtrl', [$scope, function($scope){
    
    }]);
    

    You see ? i forgot the '' around the first $scope, the right syntax is of course:

    appFormid.controller('TreeEditStepControlsCtrl', ['$scope', function($scope){
    
    }]);
    

    A first error i didn't see immediatly was: "$scope is not defined", followed by "Error: [ng:areq] Argument 'TreeEditStepControlsCtrl' is not a function, got undefined"

提交回复
热议问题