Thassa Thassa - 6 months ago 463
HTML Question

Getting AngularJS [$injector:modulerr] even when code is correct

As the title suggests, I keep getting an

[$injector:modulerr]
even with syntactically correct AngularJS code.

Updated Fiddle

I'm not sure what's going on here. Am I overlooking something?

The full error message:

angular.js:38 Uncaught Error: [$injector:modulerr]

http://errors.angularjs.org/1.5.6/$injector/modulerr?p0=app&p1=Error%3A%20%…oogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.6%2Fangular.min.js%3A21%3A19)

(anonymous function) @ angular.js:38

(anonymous function) @ angular.js:4630

q @ angular.js:322g @ angular.js:4591d

b @ angular.js:4513

Ac.c @ angular.js:1777Ac @ angular.js:1798

fe @ angular.js:1683

(anonymous function) @ angular.js:31018

i @ jquery.min.js:2

j.fireWith @ jquery.min.js:2

n.extend.ready @ jquery.min.js:2

K @ jquery.min.js:2

Answer

There were some problems with your code.
First: You missed the ng-app tag.
Second: You missed the ng-controller tag.

And the problem with fiddle is that you need to load angular by clicking in "Javascript" and selecting the framework from there and not including it as an external resource.

enter image description here

Updated fiddle here