ng-devui-materials
Version:
Materials of DevUI Admin
49 lines (46 loc) • 1.26 kB
text/typescript
import { Component } from '@angular/core';
import { ModalFormContentComponent } from './modal-form-content/modal-form-content.component';
import { DialogService } from 'ng-devui/modal';
({
selector: 'da-modal-form',
templateUrl: './modal-form.component.html',
styleUrls: ['./modal-form.component.scss'],
})
export class ModalFormComponent {
constructor(private dialogService: DialogService) {}
openstandardDialog(dialogtype?: string) {
const results = this.dialogService.open({
id: 'dialog-service',
maxHeight: '300px',
title: 'Sign In',
content: ModalFormContentComponent,
backdropCloseable: true,
dialogtype: dialogtype,
onClose: () => {
console.log('on dialog closed');
},
buttons: [
{
cssClass: 'stress',
text: 'Confirm',
handler: ($event: Event) => {
results.modalInstance.hide();
},
},
{
id: 'btn-cancel',
cssClass: 'common',
text: 'Cancel',
handler: ($event: Event) => {
results.modalInstance.hide();
},
},
],
data: {
name: 'Tom',
age: 10,
address: 'Chengdu',
},
});
}
}