Error: Argument is not a function, got undefined

前端 未结 17 1906
不思量自难忘°
不思量自难忘° 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:09

    This seriously took me 4 HOURS (including endless searches on SO) but finally I found it: by mistake (unintentionally) I added a space somewhere.

    Can you spot it?

    angular.module('bwshopper.signup').controller('SignupCtrl ', SignupCtrl);

    So ... 4 hours later I saw that it should be:

    angular.module('bwshopper.signup').controller('SignupCtrl', SignupCtrl);

    Almost impossible to see with just the naked eye.

    This stresses the vital importance of revision control (git or whatever) and unit/regression testing.

提交回复
热议问题