Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="myHappyApp">
<head>
  <script src="https://code.jquery.com/jquery-1.11.3.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<div class="list-wrapper" ng-controller="MyHappyController as myCtrl">
    <table>
        <thead>
            <tr>
                <th>Restaurant</th>
                <th>Location</th>
                <th>Status</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody class="list-view__body">
            <tr ng-repeat="restaurant in myCtrl.restaurants">
                <td>{{ restaurant.name }}</td>
                <td>{{ restaurant.location }}</td>
                <td>{{ restaurant.status }}</td>
                <td>{{ restaurant.actions }}</td>
            </tr>
        </tbody>
    </table>
</div>
</body>
</html>
 
function myHappyJqueryFunction(){
  console.log($('.list-view__body tr').length);
  // do some awesome stuff 
}
angular.module('myHappyApp',[])
  .controller('MyHappyController',['$timeout', function($timeout){
   this.restaurants=[
     {
       name:'Burger land',
       location: 'Chicago',
       status:'awesome',
       actions: 'go there'
     },
     {
       name:'Pizzamania',
       location:'Shanghai',
       status:'wicked',
       actions:'eat all the pizza!'
     }
   ];
   $timeout(function(){
       myHappyJqueryFunction();
   });
}]);
 
Output

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

Dismiss x
public
Bin info
igorshmigorpro
0viewers