Jitender
Jitender

Reputation: 7969

Angularjs basic example not working in fiddle

I have to build basic sample in angularjs but it seems not working there. I am not getting what I am doing wrong. fiddle

var myApp = angular.module('myApp', []);
myApp.controller('myCtrl', function($scope) {
    $scope.name = "my name";
})

Upvotes: 0

Views: 49

Answers (2)

Suresh B
Suresh B

Reputation: 1652

var myApp = angular.module('myApp',[]);
myApp.controller('myCtrl',function($scope){
$scope.name= "jitender";
})
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="myApp">  
  <div data-ng-controller="myCtrl">
    {{name}}
  </div>
</div>

Upvotes: 0

Anik Islam Abhi
Anik Islam Abhi

Reputation: 25352

  • You didn't choose angular version there.
  • You choose load type onLoad which won't work for angular.

Follow like the Image

enter image description here

JSFIDDLE

Upvotes: 1

Related Questions