angular.module requires doesn't work

后端 未结 1 1717
面向向阳花
面向向阳花 2021-01-26 03:15

I\'m new with angularjs and I\'m having some problems with the controllers. When I try to put something in the angular.module I only can specify the name, if I put something in

1条回答
  •  囚心锁ツ
    2021-01-26 03:56

    This statement

    angular.module('name',[])

    creates a module, whereas this statement loads the module

    angular.module('name')

    The first statement should be used once to define the module with dependencies. After that the second format should be used.

    If you use the first syntax again this leads to redefining of module and existing registration on the module are lost.

    0 讨论(0)
提交回复
热议问题