Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-app="app">
  <div ng-controller="firstCtrl">
    <div ng-repeat="item in products">
      <h4>{{item.name}}</h4>
      <button ng-if="!item.showdescription" ng-click="item.showdescription= !item.showdescription">Show description</button>
      <button ng-if="item.showdescription" ng-click="item.showdescription= !item.showdescription">Hide description</button>
      <p ng-if="item.showdescription">{{item.description}}</p>
    </div>
      </div>
</body>
</html>
 
var app = angular.module('app', []);
app.controller('firstCtrl', function($scope){
 
  $scope.products = [
    
    {name:"item one", description:"so the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."},
    {name:"item two", description:"so the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."},
    
  ];
});
Output

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

Dismiss x
public
Bin info
zieemerpro
0viewers