The directive ng-repeat
is not working properly when we give ng-app="MyApp"
and which is working without passing any value to the ng-app
directive which is a strange behaviour to me. I am new to the AngularJS. Is this behaviour expected?
Please throw some light on this.
<!DOCTYPE html>
<html>
<head>
<title>Books Buddy</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
</head>
<body ng-app="MyApp">
<div ng-init="books=['EffectiveJava','ServletBlackbook','CodeCleaner','HeadFirstJava']">
<ul>
<li ng-repeat="book in books">{{book}}</li>
</ul>
</div>
</body>
</html>