0

Can someone tell me why the hell this plunker is not working? Sample AngularJS on Plunker

HTML :

<!DOCTYPE html>
<html>

  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.6/angular.min.js"></script>
    <script src="script.js"></script>
  </head>

  <body ng-controller="MyCtrl">
    <p>{{userData}}</p>
  </body>

</html>

JavaScript:

var app = angular.module('myApp', []);
app.controller('MyCtrl', function ($scope) {
  $scope.userData = {
    name: 'Xavier',
    age: 25
  }
});
Moussa
  • 4,066
  • 7
  • 32
  • 49

1 Answers1

1

you forgot to put ng-app.

<html ng-app="myApp">
Dylan
  • 1,068
  • 12
  • 25