When you click a button, you process it in the controller and add a class
Look this
Controller:
$scope.todoClicked = function(id) { console.log("clicked", id); if (!$scope.showMoreTab[id]) { $scope.showMoreTab[id] = true; angular.forEach($scope.todos, function(todo) { if (id !== todo.id) { $scope.showMoreTab[todo.id] = false; } }); } else { $scope.showMoreTab[id] = false; } }
View:
<md-button class="md-icon-button md-toggle-icon" aria-label="More" ng-click="todoClicked(todo.id)" ng-class="{'toggled':showMoreTab[todo.id]}"> <i class="material-icons"> keyboard_arrow_down</i> </md-button>
CSS:
.md-toggle-icon.toggled { -webkit-transform: rotate(180deg); transform: rotate(180deg); }
I use the icon here, but you can also try it with svg.
<md-button class="md-icon-button md-toggle-icon" aria-label="More" ng-class="{'toggled':showMoreTab[todo.id]}" ng-click="todoClicked(todo.id)"> <md-icon md-svg-src="/material-design-icons/navigation/svg/design/ic_expand_more_36px.svg"> </md-icon> </md-button>
source share