From 7a030e1714d2e38303a4d6ce8f449381c9c165ab Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Sat, 25 Apr 2020 14:58:44 +0300 Subject: [PATCH] docs: add how to pass HTML to confirmation dialog --- docs/en/UI/Angular/Confirmation-Service.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/en/UI/Angular/Confirmation-Service.md b/docs/en/UI/Angular/Confirmation-Service.md index a8d2c4c2a7..2d1c5c1843 100644 --- a/docs/en/UI/Angular/Confirmation-Service.md +++ b/docs/en/UI/Angular/Confirmation-Service.md @@ -94,6 +94,28 @@ With the options above, the confirmation popup looks like this: ![confirmation](./images/confirmation.png) +You are able to pass in an HTML string as title, message, or button texts. Here is an example: + +```js +const options: Partial = { + yesText: 'Yes, delete it', +}; + +this.confirmation.warn( + ` + Role Demo will be deleted +
+ Do you confirm that? + `, + 'Are you sure?', + options, +); +``` + +Since the values are HTML now, localization should be handled manually. Check out the [LocalizationService](./Localization#using-the-localization-service) to see how you can accomplish that. + +> Please note that all strings will be sanitized by Angular and not every HTML string will work. Only values that are considered as "safe" by Angular will be displayed. + ### How to Remove a Confirmation Popup The open confirmation popup can be removed manually via the `clear` method: