0

I have a strange issue setting up a jsfiddle. I have tried adding an Angular library but it doesn't seem to work in mine.

Mine- Not working

example working

Any thoughts?

(code below compulsory but not the issue as identical for both)

var app = angular.module('app',[]);

function AppCtrl($scope) {
    $scope.name = 'Sally';
}
martyn
  • 230
  • 5
  • 22

3 Answers3

0

You forgot to set ng-app. In version 1.0.5 it was not yet required, but since somewhere 1.2.x you have to set it .

try this:

<div ng-app="app" ng-controller="AppCtrl">
    Hello {{name}}
</div>
Michael
  • 3,085
  • 1
  • 17
  • 15
  • maybe you want to check out this one [tab issue with ui-bootstrap](http://stackoverflow.com/questions/32867303/ui-bootstrap-angular-filter-in-tab-conflict) – martyn Sep 30 '15 at 13:41
0

The difference in the two JSFiddles are the body tag.

The working one: <body ng-app="app"> Yours: <body>

You can add your custom body tag in the Fiddle Options section.

This image is taken from the working one:

enter image description here

Night2
  • 1,168
  • 9
  • 18
0

IN JS Fiddle, Check "Fiddle Options" in left panel , Open it , you will find input box called body tag, Copy the below code and paste it to body tag input box..

<body ng-app="app">

Thats it..

NiranjanK
  • 427
  • 2
  • 6
  • 23