Debajit Majumder Debajit Majumder - 6 months ago 9
AngularJS Question

$injector:modulerr error in angularjs for the same code

I am sure that I am doing a silly mistake somewhere but I am unable to detect it. I have exactly same two js fiddles, one is working and another one doesn't, giving

$injector:modulerr
error.

Working Fiddle: http://jsfiddle.net/dmajumder/tG46g/13/

Non-working Fiddle: http://jsfiddle.net/dmajumder/6tyb41gu/1/

It might be a jsFiddle problem also. Forgive me if I am doing a very silly mistake but please help me to get out of this.

Answer

In working fiddle you included the AngularJS library AngularJS 1.2.1.

enter image description here

But in not working fiddle you forgot to add the AngularJS library.

enter image description here

no wrap - in <head>:

This will place your JavaScript code in the <head> section.

no wrap - in <body>:

This will place your JavaScript code in the <body> section.

I would like to note that more information can be found in JsFiddle Documentation.

So, please add and see the magic. It will work.

Comments