1. ホーム
  2. angular

angularjsのボタンクリックの色変更の実装

2022-02-18 16:36:19
Implement angularjs color change after clicking on a button in angularjs
<button ng-click="updateUsercode(item)" ng-repeat="item in ticket" class="button button-small pj " ng- class="{'acti':(islActive.ticketName == item.ticketName)}" >{
{}} ¥{
{}}</button>



                   $scope.islActive = "";
                   $scope.updateUsercode = function(item){
                	   $scope.islActive = item;
                   };





<button ng-click="updateUsercode(item)" ng-repeat="item in ticket" class="button button-small pj " ng- class="{'acti':(islActive.ticketName == item.ticketName)}" >{
{}} ¥{
{}}</button>


                   $scope.islActive = "";
                   $scope.updateUsercode = function(item){
                	   $scope.islActive = item;
                   };


.アクティ
background-color: #387DF5
    box-shadow: none;
    色になります。#fffです。
}