2
I understood that you want to select and be marked the item:
Minimal example:
var app = angular.module("app", []);
app.controller("ctrl", ["$scope",
function($scope) {
$scope.btns = [{
name: "btn1",
title: "Sim",
status: true
}, {
name: "btn2",
title: "Não consta",
status: false
}, {
name: "btn3",
title: "Não",
status: false
}];
$scope.checkStatus = function(btn) {
$scope.setStatus(false);
btn.status = true;
}
$scope.setStatus = function(sts) {
angular.forEach($scope.btns, function(obj, v) {
obj.status = sts;
});
}
}
]);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div ng-app="app" ng-controller="ctrl">
<div class="btn-group" data-toggle="buttons">
<label ng-class="btn.status?'btn btn-success active':'btn btn-info'" ng-click="checkStatus(btn)" ng-repeat="btn in btns">
<input type="checkbox" ng-checked="btn.status" autocomplete="off">{{btn.title}}
</label>
</div>
</div>
I did not understand well, validate would be when clicking a different button mark with green as example above?
– novic
That! in addition to changing the button color. send via post to another page in order to be assigned to a request!
– alexjosesilva
Your question is very limited to the buttons changing the color when they are selected, you can attach this and ask a new question, and if any answer served to remove the accepted doubt as an answer. See, in your initial question you don’t have the requisition part and here we answer the questions as per the question. You can open a new explained plus what you need referring to this.
– novic