Skip to content

Commit

Permalink
Merge pull request #20682 from E-Aghbari/ngb-modaloptions
Browse files Browse the repository at this point in the history
NgbModalOptions Examples
  • Loading branch information
sumeyyeKurtulus authored Sep 19, 2024
2 parents 5daf174 + dab9515 commit b86c3be
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions docs/en/framework/ui/angular/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,59 @@ The modal with form looks like this:

**`options`** is an input typed [NgbModalOptions](https://ng-bootstrap.github.io/#/components/modal/api#NgbModalOptions). It is configuration for the `ng-bootstrap` modal.


**Examples:**

- `animation`: This is an NgbModalOption property of type *boolean*. It controls whether the modal opens and closes with an animation. By default, it is set to true, meaning that the modal will have a smooth transition when it opens and closes. Setting it to false will disable these animations.

```js
import { Component } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';

@Component({
selector: 'ngbd-modal-options',
...})

export class NgbdModalOptions {
modalService = inject(NgbModal);
animationModal(content) {
this.modalService.open(content, { animation: true });
}
}
```

       The result of this configuration would be like this:

![Modal example result](./images/animation-true.gif)

       On the contrary, if we set it as false:

![Modal example result](./images/animation-false.gif)


- `fullscreen`: This is an NgbModalOption property of type *boolean or string*. When set to `true`, the element will expand to cover the entire screen, hiding all other interface elements. When set to `false`, the element remains in its regular size and position within the page.

```js
import { Component } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';

@Component({
selector: 'ngbd-modal-options',
...})

export class NgbdModalOptions {
modalService = inject(NgbModal);
fullscreenModal(content) {
this.modalService.open(content, { fullscreen: true });
}
}

```

       If `fullscreen: true`:

![Modal example result](./images/fullscreen-true.png)

#### suppressUnsavedChangesWarning

```js
Expand Down

0 comments on commit b86c3be

Please sign in to comment.