import { Component, inject } from '@angular/core';
import { DemoModalComponent } from '@shared';
import { ModalHelper } from '@yelon/theme';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'theme-modal-simple',
template: `
<button nz-button (click)="open()">Open</button>
<button nz-button (click)="static()">Static</button>
`,
standalone: true,
imports: [NzButtonModule]
})
export class ThemeModalSimpleComponent {
private modalHelper = inject(ModalHelper);
private msg = inject(NzMessageService);
open(): void {
this.modalHelper.create(DemoModalComponent, { record: { a: 1, b: '2', c: new Date() } }).subscribe(res => {
this.msg.info(res);
});
}
static(): void {
this.modalHelper.createStatic(DemoModalComponent, { record: { a: 1, b: '2', c: new Date() } }).subscribe(res => {
this.msg.info(res);
});
}
}