简体   繁体   中英

Multiple rows of buttons acting like radio buttons in angularJS

The issue here is I have three buttons per row and I need one buttons value to be save:

  • eg: if the good button is clicked I need to save good and if another button is clicked, then the previous value should replace by the current value.

Exactly same for other row buttons.every buttons per row as selected should activate the buttons.

I am new to angular and i have no code to show here.

Don't you want to use radio from https://angular-ui.github.io/bootstrap/ ?

naive realisation is

<span ng-bind="vm.value"></span>
<button ng-click="vm.value = 1">1</button>
<button ng-click="vm.value = 2">2</button>
<button ng-click="vm.value = 3">3</button>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM