-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
36 lines (32 loc) · 954 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import 'zone.js/dist/zone';
import { Component, ElementRef, ViewChild } from '@angular/core';
import { CommonModule } from '@angular/common';
import { bootstrapApplication } from '@angular/platform-browser';
@Component({
selector: 'my-app',
standalone: true,
imports: [CommonModule],
templateUrl: './main.html',
})
export class App {
@ViewChild('lightbox', { static: false }) lightbox?: ElementRef;
@ViewChild('modal', { static: false }) modal?: ElementRef;
modalOpen: boolean = false;
showModal: boolean = false;
loader: boolean = false;
openModal() {
this.modalOpen = true;
this.showModal = true;
}
closeModal() {
this.showModal = false;
this.loader = true;
this.lightbox!.nativeElement.classList.add('hide-lightbox');
this.modal!.nativeElement.classList.add('hide-modal');
setTimeout(() => {
this.modalOpen = false;
this.loader = false;
}, 300);
}
}
bootstrapApplication(App);