Angular JS, 'nomod',Module '{0}' is not available! You either misspelled

后端 未结 3 1452
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-03 02:16

This is the code in my index.html






        
相关标签:
3条回答
  • 2021-01-03 02:47

    well it happened to me too today - looking for answers no one said the reason i had. just misspelled the word function (can be anything else) and that caused the whole module not to load.

    Shlomi

    0 讨论(0)
  • 2021-01-03 02:47

    Well, I don't see any sort of angular bootstrapping file, so it looks like you don't have a module yet, so the error makes sense. Make an app.js file, and place this in it

    var app = angular.module('app',
    [
        // you'll use this space later, for stuff like ngRoute and ngResource,
    ]);
    

    then load the file in your html and change <html ng-app=""> to <html ng-app="app">

    0 讨论(0)
  • 2021-01-03 02:49

    I have to link you to AngularJS documentation

    Angularjs $injector::nomod

    which basically says that your module should be defined as:

    angular.module('myApp',[]);
    
    0 讨论(0)
提交回复
热议问题