Angular JS Uncaught Error: [$injector:modulerr]

后端 未结 15 1829
攒了一身酷
攒了一身酷 2020-12-09 01:08

I am having a problem with Angular JS receiving an error : Uncaught Error: [$injector:modulerr]. My JS-file looks

angular.module(\'MyApp\', [\'ngRoute\']);
         


        
15条回答
  •  Happy的楠姐
    2020-12-09 01:58

    The error means that the dependency injector was unable to locate the dependency 'ngResource'. The script tag in the accepted answer provides this dependency.

    You will also get the same error if you add any custom modules in the dependencies but did not add the script tag for including the '.js' file containing the dependency.

提交回复
热议问题