i want to get a confirm dialog in my program, but it doesn't work. The Window is not opening, with a normal dialog the use-case worked.
The code above are only snippets from my real .ts file
Code:
Code: Select all
import { MenuItem, TreeNode, ConfirmationService, ConfirmDialogModule } from 'primeng/primeng';
constructor(private route: ActivatedRoute,
private router: Router,
private confirmationService: ConfirmationService)
onDelete() {
console.log("Confirmservice");
this.confirmationService.confirm({
message: 'Test',
header: 'Confirmation',
icon: 'fa fa-question-circle',
accept: () => {
console.log("Worked");
});
}
reject: () => {
console.log("Test");
}
}
)
}
Code: Select all
<div class="ui-g-12 ui-md-4">
<button pButton label="Try" icon="ui-icon-delete" (click)="onDelete()"></button>
</div>