Some angularjs examples not working in jsfiddle and plunker-Collection of common programming errors
JSFiddle in particular has always been difficult to get working with AngularJS. The HTML section isn’t meant to take an entire HTML document. Instead, you need to configure the workspace to work with Angular following these steps:
- Under external resources, add the Angular script (remember to click the + icon)
- Under Fiddle Options change the
body
tag to includeng-app
like so:
That should get you started. If you don’t mind using an older version of Angular (1.1.1), you can select it from the “Frameworks & Extensions” drop down and change the 2nd drop down from onLoad
to No wrap - in
.
See here for a working example from the docs: http://jsfiddle.net/jPtb3/
And here for the optional approach using 1.1.1: http://jsfiddle.net/5nA2H/
Update
There’s some misinformation in the comments.. The docs ARE actually creating angular.module
for you, but they’re passing in an empty dependency. So you can either remove ="App"
(not best), or you fix the angular.module
declaration by removing the empty dependency (best) like so:
angular.module('App', []);
Originally posted 2013-12-01 09:11:06.