JSFiddle - React, Tailwind, and code Playground
by Md. Noor Alam
HTML
<div ng-controller="MyCtrl">
<div ng-repeat="rfi in rfiList | orderBy:['name', 'status'] track by $index">
<p>
{{rfi.name}}==>{{rfi.status}}
<button ng-click="search($index)">OK
</button>
</p>
</div>
</div>
JavaScript
var myApp = angular.module('myApp', []);
function MyCtrl($scope) {
$scope.rfiList = [{
name: 'GHI',
status: true
},
{
name: 'GHI',
status: false
},
{
name: 'DEF',
status: true
},
{
name: 'DEF',
status: false
},
{
name: 'ABC',
status: true
},
{
name: 'JKL',
status: true
}
];
$scope.search = function(index) {
alert('Index is=' + index + ' and value is=' + $scope.rfiList[index].name + '-->' + $scope.rfiList[index].status);
};
}