ng-repeat 在angularJS中用法

<!doctype html>
<html lang="en" ng-app="myAPP">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="http://apps.bdimg.com/libs/angular.js/1.3.9/angular.min.js"></script>
</head>
<body>
    <div ng-controller="studentController">
        <ul>
            <li ng-repeat="student in students">
                <a href="/views/{{student.id}}">{{student.name}}</a>
            </li>
        </ul>
    </div>
    <script>
var students=[
{"id":"12","name":"join"},
{"id":"13","name":"join1"},
{"id":"14","name":"join2"},
{"id":"15","name":"join3"}
];
var myAPP=angular.module('myAPP',[]);
myAPP.controller('studentController',function($scope){
    $scope.students=students;/views/
});
    </script>
</body>
</html>
發佈了75 篇原創文章 · 獲贊 5 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章