hansi
hansi

Reputation: 2298

AngularJS: Uncaught Error: [$injector:modulerr] from angular include

I get the Uncaught Error: [$injector:modulerr] from just the angular include, I'm guessing since there's not a whole lot more.

What am I doing wrong?

<!doctype html>
<html ng-app="demo">
<head>
<title>Hello AngularJS</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular.min.js"></script>
</head>
<body>
</body>
</html>

Error:

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.6.3/$injector/modulerr?p0=demo&p1=Error%3A%20…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.6.3%2Fangular.min.js%3A22%3A179)
    at angular.js:38
    at angular.js:4920
    at p (angular.js:402)
    at g (angular.js:4880)
    at eb (angular.js:4802)
    at c (angular.js:1909)
    at Pc (angular.js:1930)
    at ue (angular.js:1815)
    at angular.js:33340
    at HTMLDocument.b (angular.js:3435)

Upvotes: 2

Views: 1776

Answers (1)

Akashii
Akashii

Reputation: 2281

You write ng-app="demo" but dont have script file js . Pls add it

(function(){
 angular.module('demo',[]);
})()

and add in html

<script src="script.js></script>

Upvotes: 5

Related Questions