src/app/core/common-components/dialog-close/dialog-close.component.ts

Index

Properties

Properties

button
Type : MatButton
Decorators :
@ViewChild('button')
import {
  AfterViewChecked,
  Component,
  ViewChild,
  ChangeDetectionStrategy,
} from "@angular/core";
import { MatButton, MatButtonModule } from "@angular/material/button";
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
import { MatDialogClose } from "@angular/material/dialog";

@Component({
  changeDetection: ChangeDetectionStrategy.OnPush,
  selector: "app-dialog-close",
  templateUrl: "./dialog-close.component.html",
  styleUrls: ["./dialog-close.component.scss"],
  imports: [FontAwesomeModule, MatButtonModule, MatDialogClose],
})
export class DialogCloseComponent implements AfterViewChecked {
  @ViewChild("button") button: MatButton;

  ngAfterViewChecked() {
    (<HTMLButtonElement>this.button._elementRef.nativeElement).blur();
  }
}
<button mat-icon-button class="overlay-close-button" mat-dialog-close #button>
  <fa-icon icon="times"></fa-icon>
</button>

./dialog-close.component.scss

/**
 * Positions the 'x' button that is shown for an overlay to
 * the top-right of the overlay
 */
.overlay-close-button {
  position: absolute;
  top: 0;
  right: 0;
  border-radius: 0 4px 0 4px;
}

:host ::ng-deep .mat-mdc-icon-button .mat-mdc-button-persistent-ripple {
  border-radius: 0 4px 0 4px;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""