-1
Я новичок в AngularJS. Хотя это простая проблема, я нашел аналогичную ошибку, но причина была другая.Модуль AngularJS 'myApp' недоступен
Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to: Error: [$injector:nomod] Module 'myApp' 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.
У меня есть файл index.html:
<html ng-app="myApp">
<head>
<title>Module example</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular-route.js"></script>
<script src="app.js" type="text/javascript"/>
</head>
<body>
2 + 2 = {{2 + 2}}
</body>
мой app.js файл является:
angular.module('myApp', []);
Не могли бы вы помочь мне решить эту проблему.
try
тег сценария не закрыта правильно, оно должно быть:
источник
2016-01-11 19:35:58 MCSI
Гай, вы забыли закрыть тег сценария ! И ваш тег html! И ваш doctype!
Try:
И это работает ...
Взгляните на https://validator.w3.org, прежде чем спрашивать здесь, пожалуйста.
источник
2016-01-11 19:42:33 chalasr