simple code is not working

20 views
Skip to first unread message

Ashutosh Das

unread,
Aug 4, 2014, 2:47:13 AM8/4/14
to ang...@googlegroups.com
Here is my simple hello world type code ... Dont know why this code is  not working . 

index.html :

<!DOCTYPE html>
<html ng-app="book">
  <head>
    <script type=”text/javascript” src="angular.js"></script>
    <script type=”text/javascript” src="book.js"></script>
  </head>
  <body>
    <div ng-controller="MainCtrl">
      <span>hello: {{world}}</span>
    </div>
  </body>
</html>

book.js:

angular.module('book', []);
var MainCtrl = function($scope) {
  $scope.world = 'world';
};

when I open index.html file in my browser it shows : hello: {{world}}

I am using angularjs version 1.2.16 , and all of those files in same folder .

Prateek Jain

unread,
Aug 4, 2014, 4:28:35 AM8/4/14
to ang...@googlegroups.com
use latest version of angular, it will work then.

Ashutosh Das

unread,
Aug 4, 2014, 5:29:09 AM8/4/14
to ang...@googlegroups.com
I tried but not worked


--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/4F8rF6m7nIM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Pavel Vorobyov

unread,
Aug 4, 2014, 6:20:24 AM8/4/14
to ang...@googlegroups.com
this one should work properly:


var MainCtrl = function($scope) {
    $scope.world = 'world';
};
angular.module('book', [])
  .controller('MainCtrl', MainCtrl);


понедельник, 4 августа 2014 г., 13:29:09 UTC+4 пользователь Ashutosh Das написал:
Reply all
Reply to author
Forward
0 new messages