I go through the sample code in tutorial but its works for me when I created app using aurelia cli but when I create same app using webpack that not work.
This is the code i taken from tutorial
import {EditPerson} from './edit-person';
import {DialogService} from 'aurelia-dialog';
export class Welcome {
static inject = [DialogService];
constructor(dialogService) {
this.dialogService = dialogService;
}
person = { firstName: 'Wade', middleName: 'Owen', lastName: 'Watts' };
submit(){
this.dialogService.open({viewModel: EditPerson, model: this.person}).then(openDialogResult => {
// Note you get here when the dialog is opened, and you are able to close dialog
setTimeout(() => {
openDialogResult.controller.cancel('canceled outside after 3 sec')
}, 3000);
// Promise for the result is stored in openDialogResult.closeResult property
return openDialogResult.closeResult;
}).then((response) => {
if (!response.wasCancelled) {
console.log('good');
} else {
console.log('bad');
}
console.log(response);
});
}
}
My problem is close dialog box after 3 sec.