Hi,

I ran an example of 'ng-repeat' directive and it is not working. I spent a 
lot of time on figuring what it is missing and I did not succeed. Please 
help if you have the solution.

The code of file 'myexample.jsp':


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <script 
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js";></script>
</head>

<body ng-app="myapp">

<script>
    var myList = function($scope){
        $scope.foods = ['Pizza','Pasta','Burger','Icecream','Pepsi'];
    };
</script>

<div ng-controller="myList" ng-model="foods">
    <ul>
        <li ng-repeat="food in foods">{{food}}</li>
    </ul>
</div>

</body>
</html>

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to