Error using module in angularJS -
i new angular.js , have problem. please me resolve it. have created simple screen using controller , module in example. doesnt work. have presented example follows :
my html file :-
<!doctype html> <html ng-app="ayan"> <head> <script type="text/javascript" src="hotel_listing_angular.js"></script> <script type="text/javascript" src="http://code.angularjs.org/1.0.6/angular.min.js"></script> <title>insert title here</title> </head> <body> <div ng-controller="mycontroller"> <ul> <li ng-repeat="contact in htllist"> {{ contact.name }} </li> </ul> </div> </body> </html>
and js file follows :-
var ayan=angular.module('ayan',[]); ayan.controller('mycontroller',function ($scope) { $scope.htllist = [ {name:"picard", description:"captain"}, {name:"santosh", description:"programmer"}, {name:"amit", description:"manager"} ]; });
please tell me doing wrong.
you need include
<script type="text/javascript" src="http://code.angularjs.org/1.0.6/angular.min.js"></script>
before
<script type="text/javascript" src="hotel_listing_angular.js"></script>
Comments
Post a Comment