Skip to content

Commit

Permalink
feat: adjusted documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Feb 5, 2024
1 parent 5e42fba commit 5cdbbe0
Showing 1 changed file with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ export class PortalDialogService {
*
* ```
* // assume 'TITLE_KEY', 'WELCOME_MESSAGE', 'OK_BUTTON' and 'REFRESH_BUTTON' are translation keys
* this.portalDialogService.openDialog('TITLE_KEY', 'WELCOME_MESSAGE', 'OK_BUTTON', 'REFRESH_BUTTON')
* this.portalDialogService.openDialog('TITLE_KEY', 'WELCOME_MESSAGE', 'OK_BUTTON', 'REFRESH_BUTTON').subscribe((stateOnClose) => {
* // operations when dialog has been closed
* })
* ```
*
* @example
Expand All @@ -258,7 +260,9 @@ export class PortalDialogService {
* key: 'WELCOME_MESSAGE',
* icon: 'pi pi-question'
* }
* this.portalDialogService.openDialog('TITLE_KEY', dialogMessage, 'OK_BUTTON')
* this.portalDialogService.openDialog('TITLE_KEY', dialogMessage, 'OK_BUTTON').subscribe((stateOnClose) => {
* // operations when dialog has been closed
* })
* ```
*
* @example
Expand All @@ -277,21 +281,25 @@ export class PortalDialogService {
* icon: 'pi pi-refresh'
* }
*
* this.portalDialogService.openDialog('TITLE_KEY', 'WELCOME_MESSAGE', primaryButton, secondaryButton)
* this.portalDialogService.openDialog('TITLE_KEY', 'WELCOME_MESSAGE', primaryButton, secondaryButton).subscribe((stateOnClose) => {
* // operations when dialog has been closed
* })
* ```
*
* @example
* Display dialog message without X button in top right corner
*
* ```
* this.portalDialogService.openDialog('TITLE_KEY', 'WELCOME_MESSAGE', 'OK_BUTTON', 'REFRESH_BUTTON', false)
* this.portalDialogService.openDialog('TITLE_KEY', 'WELCOME_MESSAGE', 'OK_BUTTON', 'REFRESH_BUTTON', false).subscribe((stateOnClose) => {
* // operations when dialog has been closed
* })
* ```
*
* @example
* React on dialog closing
*
* ```
* this.portalDialogService.openDialog('TITLE_KEY', 'WELCOME_MESSAGE', 'OK_BUTTON', 'REFRESH_BUTTON').subscribe((state) => {
* this.portalDialogService.openDialog('TITLE_KEY', 'WELCOME_MESSAGE', 'OK_BUTTON', 'REFRESH_BUTTON').subscribe((stateOnClose) => {
* // operations when dialog has been closed
* })
* ```
Expand Down Expand Up @@ -333,7 +341,19 @@ export class PortalDialogService {
* header: 'DIALOG_HEADER'
* }
* }
* this.portalDialogService.openDialog('TITLE_KEY', myComponent, 'OK_BUTTON', 'REFRESH_BUTTON')
* this.portalDialogService.openDialog('TITLE_KEY', myComponent, 'OK_BUTTON', 'REFRESH_BUTTON').subscribe((stateOnClose) => {
* // operations when dialog has been closed
* })
* ```
*
* @example
* Display dialog with component without passing inputs
*
* ## PortalDialogService call
* ```
* this.portalDialogService.openDialog('TITLE_KEY', MyInputComponent, 'OK_BUTTON', 'REFRESH_BUTTON').subscribe((stateOnClose) => {
* // operations when dialog has been closed
* })
* ```
*/
openDialog<T>(
Expand Down

0 comments on commit 5cdbbe0

Please sign in to comment.