Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="app">
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
<script src="//cdn.bootcss.com/angular.js/1.4.7/angular.js"></script>  
</head>
<body ng-controller="MainCtrl as main">
<div>
  <div class="item" 
       ng-repeat="item in main.items" 
       ng-click="main.toggle(item)" >
    <div>{{item.name}}</div>
    <div ng-init="item.show=false" ng-show="item.show">
      初始隐藏
    </div>
  </div>
</div>
</body>
</html>
 
.item {
  border:1px solid #333;
  padding:10px 20px;
  margin:5px;
  background-color: #f5f5f5;  
}
 
angular.module('app',[])
.controller('MainCtrl',function(){
  this.items = [{
      name: 'a'
    }, {
      name: 'b'
    }, {
      name: 'c'
    }];
  this.toggle = function(item){
    item.show = !item.show;
  };
});
Output 300px

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

Dismiss x
public
Bin info
yangjunjunpro
0viewers