feat(modal): add simple modal component with open and close functionality
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
||||
|
||||
import {
|
||||
SimpleModalData,
|
||||
MODAL_DATA,
|
||||
ModalRef
|
||||
} from '../../../core/services/modal.service';
|
||||
import { ButtonComponent } from '../button/button.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-simple-modal',
|
||||
imports: [ButtonComponent],
|
||||
templateUrl: './simple-modal.component.html',
|
||||
styleUrl: './simple-modal.component.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class SimpleModalComponent {
|
||||
protected readonly data = inject<SimpleModalData>(MODAL_DATA);
|
||||
private readonly modalRef = inject<ModalRef<void>>(ModalRef);
|
||||
|
||||
protected close(): void {
|
||||
this.modalRef.close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user