Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>  
<html>  
<head>  
<meta charset="UTF-8">  
<title>Angular js</title>  
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>  
<script src="app.js"></script>  
  
</head>  
<body>  
<div ng-app="myApp" ng-controller="java2blogContoller">  
  <table border="1">
    <thead>
  <tr>
     <th>Name</th>
     <th>Captial</th>
  </tr>
 </thead>
  <tr ng-repeat="con in countries">
    <td ng-if="$odd" style="background-color:#f1f1f1"> {{ con.name }}</td>
    <td ng-if="$even" style="background-color:#f1aaaa"> {{ con.name }}</td>
    <td ng-if="$odd" style="background-color:#f1f1f1">{{ con.capital }}</td>
    <td ng-if="$even" style="background-color:#f1aaaa">{{ con.capital }}</td>
  </tr>
</table>
 </br>   
</div>  
</body>  
</html> 
 
var app = angular.module('myApp', []);
    app.controller('java2blogContoller', function($scope) {
      
      $scope.countries=
        [
        {"name": "India" , "capital" : "delhi"},
         {"name": "England" , "capital" : "London"},
         {"name": "France" , "capital" : "Paris"},
         {"name": "Japan" , "capital" : "Tokyo"}
               
      ];
         
    });
Output

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

Dismiss x
public
Bin info
arpitmandliyapro
0viewers