PRIDE Archive Search
HTML
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<div class="container" ng-app="testApp">
<div ng-controller="testCtrl">
<p>Here are the errors</p>
<table>
<tr ng-repeat="error in errors">
<td><input ng-model="error.id"/></td>
<td><input ng-model="error.name"/></td>
<td><button ng-click="removeError(error)">-</button></td>
</tr>
</table>
</div>
</div>
JavaScript
var app = angular.module('testApp', []);
app.controller('testCtrl', function ($scope) {
$scope.errors=[{id: 5, name: "five"}, {id: null, name: "new1"}, {id: 1, name: "one"}, {id: null, name: "new1"}, {id: null, name: "new2"}];
$scope.removeError = function(error) {
var index = $scope.errors.indexOf(error);
if (index !== -1) {
$scope.errors.splice(index, 1);
}
};
});