Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app>
<head>
  
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script>
<meta charset=utf-8 />
<title>ng-repeat</title>
</head>
<body>
  
  <div ng-controller="MainCtrl">
    
    <p ng-repeat="name in names track by $index">{{$index+1}}. {{name}}</p>
    
    <p>以上有{{names.length}}筆資料</p>
    <ul>
      <li ng-class='{value1:$even}' ng-repeat="item in items">{{item.title}} </li>
    </ul>
    <p>以上有{{items.length}}筆資料</p>
  </div>
</body>
</html>
 
function MainCtrl($scope) {
    
  $scope.names = ['Lily', 'Lucy', 'Marry', 'John', 'Nana'];
  
  $scope.items = [
            {title: '性別', status: '1'},
            {title: '血型', status: '0'},
            {title: '生日', status: '1'}
            ];
  
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers