Angular Button Click Rotate Icon February 15, 2024 Post a Comment I have the following button Solution 1: You can add a flag in your component as follows:@Component({ ... template: ` <button class="btn btn-primary btn-sm" [ngClass]="{'clicked': isClicked}" type="button" (click)="executeUsecase(usecase.UsecaseId)">> <i class="fa fa-play"></i> </button> ` }) exportclassComponent { ... isClicked: false; executeUsecase(id) { ... this.isClicked = true; } } Copycss: .btn { transition: all 2s ease-out !important; } .clicked { transform: rotate(20deg) } CopyBaca JugaIterate Through Datasource In Mat-table AngularToggle A Class By A Button From Header Component That Affect Main App Component By Angular 6+Angular Multiple Layouts Routing Is Not Working Share You may like these postsMake A Collection Of Svg Files Into Something Like Fontawesome's Js?Switch Between Icons When Using Fontawesome 5.0 Svg FrameworkPut Font Awesome Icon In Top Right CornerFont Awesome Icons Not Aligning Correctly Post a Comment for "Angular Button Click Rotate Icon"
Post a Comment for "Angular Button Click Rotate Icon"