Reputation: 1
This is my code: html:
<div ng-controller="ButtonController">
<button class=" circle-white btn btn-collapse-custom" ng-click="collapse(1); toggleBtn()">
<i ng-show="imgbtn" class="fa fa-chevron-down"></i>
<i ng-hide="imgbtn" class="fa fa-times"></i>
</button>
</div>
js:
'use strict'
module.exports = function($scope , $rootScope ){
$scope.imgbtn = true;
$scope.toggleBtn = function() {
$scope.imgbtn = $scope.imgbtn === false ? true: false;
};
};
this work's fine.
the problem is when another button is clicked ,the previous click stay active so the cross don't change.
Now another button is clicked , and previous is active yet
Idk how to change the 'active' , any other solution ?
Upvotes: 0
Views: 88
Reputation: 1040
Just guessing what you want to achieve, but you should try this:
<div ng-controller="ButtonController">
<button class=" circle-white btn btn-collapse-custom" ng-click="collapse(1); imbtn = !imbtn">
<i ng-class="{'fa fa-chevron-down': imbtn, 'fa fa-times': !imbtn}">
</i>
</button>
</div>
Upvotes: 1