button.html 538 B

12345678910111213141516171819202122
  1. <button
  2. [type]="type()"
  3. [class]="classes()"
  4. [disabled]="disabled() || loading()"
  5. [attr.aria-busy]="loading() || null"
  6. [attr.aria-label]="ariaLabel() || null"
  7. >
  8. @if (loading()) {
  9. <i class="fa-solid fa-spinner animate-spin" aria-hidden="true"></i>
  10. @if (loadingText()) {
  11. <span>{{ loadingText() }}</span>
  12. }
  13. } @else {
  14. @if (icon()) {
  15. <i [class]="icon()" aria-hidden="true"></i>
  16. }
  17. <ng-content />
  18. @if (iconRight()) {
  19. <i [class]="iconRight()" aria-hidden="true"></i>
  20. }
  21. }
  22. </button>