angular 1.3 can't find the controller function

后端 未结 1 1413
北海茫月
北海茫月 2020-12-03 21:40

I am new to angular and tried to go with 1.3 new release.
Here is my code



        
相关标签:
1条回答
  • 2020-12-03 22:07

    Global controller functions are no longer supported by default in 1.3. See change log...

    $controller will no longer look for controllers on window. The old behavior of looking on window for controllers was originally intended for use in examples, demos, and toy apps. We found that allowing global controller functions encouraged poor practices, so we resolved to disable this behavior by default.

    It can be re-enabled with this config...

    angular.module('myModule').config(['$controllerProvider', function($controllerProvider) {
      // this option might be handy for migrating old apps, but please don't use it
      // in new ones!
      $controllerProvider.allowGlobals();
    }]);
    
    0 讨论(0)
提交回复
热议问题