Module is not available, misspelled or forgot to load (but I didn't)

后端 未结 9 2227
伪装坚强ぢ
伪装坚强ぢ 2020-12-13 12:17

I am fairly new to angular and using it with JSON api files. TO test, I am trying to use the free github api (my names for functions are for a different json api that i will

9条回答
  •  难免孤独
    2020-12-13 12:49

    Using AngularJS 1.6.9+

    There is one more incident, it also happen when you declare variable name different of module name.

    var indexPageApp = angular.module('indexApp', []);
    

    to get rid of this error,

    Error: [$injector:nomod] Module 'indexPageApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

    change the module name similar to var declared name or vice versa -

    var indexPageApp = angular.module('indexPageApp', []);
    

提交回复
热议问题