Questions tagged [ng-modal]

An AngularJS directive that provides a modal UI.

An AngularJS directive that provides a modal UI. See the github repository for more info.

20 questions
38
votes
7 answers

Angular7 and NgbModal: how to remove default auto focus

we just upgraded our application to angular 7 and we noticed that all ngBootstrap modals have now a default autofocus on the close button like the following picture. here is my code: html modal code:
Flow
  • 550
  • 1
  • 4
  • 12
14
votes
5 answers

*ngFor resetting all form values when adding new input element

I have an Angular2 app with a button that can add another loan to my loans. My *ngFor is pretty simple also:
9
votes
1 answer

Mock NgbModal in Angular

I need to mock a NgbModal to do some unit tests in angular, but I have no idea how to do this. This is my function: openModal(deviceID: string, productID: string){ const modalRef = this.modalService.open(ProductModal) …
Daria Domagała
  • 703
  • 1
  • 6
  • 7
9
votes
1 answer

Angular 2: NgbModal transclude in view

Let's say i have such modal template: and i'm calling this modal from another…
brabertaser19
  • 5,678
  • 16
  • 78
  • 184
3
votes
3 answers

Angular NgbModal, how to correctly close a modal window?

I am working on an Angular application using NgbModal to handle modal. I have some doubts about how properly close a modal implemented with this component (untill now I always used PrimeNg instead ng-bootstrap). Basically I have done in this way…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
3
votes
1 answer

How Scroll to a div in ng-template?

Im using ngb modal to for a pop up where the content is set inside a . On submit (on error) I need to automatically scroll down to the error section. I tried @viewchild on the
but since its part of the template the…
Folgers123
  • 33
  • 6
3
votes
1 answer

Does the windowClass property or NgbModalOptions actually do anything?

I am opening an NgbModal passing a TemplateRef to create the dialog body, and passing in a custom class via the windowClass property of the NgbModalOptions object that I pass to the open() method. I define the class in a referenced styleUrl in the…
burghboy
  • 53
  • 4
1
vote
1 answer

Refresh a Select Dropdown After Saving Modal Form

I' ve got a modal form "AddProductComponent" which is called inside "AddServiceRecordsComponent". export class AddProductComponent implements OnInit { id!: string; isAddMode: boolean = false; constructor(private fb: FormBuilder, private…
lutfucan
  • 151
  • 3
  • 12
1
vote
1 answer

Angular NgModal opens but can't click in any input or button

Problem: I have a button inside a component that opens another component as a modal. The button works and it opens the modal, except I can't click in anything, neither the inputs or the cross. I already inserted the component as an entryComponent in…
Luis Luis Maia Maia
  • 681
  • 1
  • 10
  • 30
1
vote
3 answers

Angular2 bootstrap modal with child component

I would like to use Ng Bootstrap Modal with a child component as the modal body. I'm not sure how I would achieve this... export class ParentComponent { @ViewChild("modal") private engineModal: TemplateRef; dialog: NgbModalRef | null; …
0
votes
2 answers

How to not update the data after cancel or close the modal in Angular?

I have created a bootstrap NgModal. In table, after click on edit button, it contains a form with some input fields. If I click on save it is working fine but If I click on cancel it is closing but also it is updating the fields data. I want if I…
Utkarsh
  • 1
  • 5
0
votes
1 answer

Angular 11 - mat-sort is not working in ng-modal table

mat-sort and paginator is not working in ng-modal table. But outside modal it is working properly. Are there any workaround for this issue?
0
votes
1 answer

Group by Question and ng-model differentiation with AngularJS

The objective is to make a survey which has N questions and N question options. I am trying to group the questions and then differentiate each radio button with ng-model with its value to obtain an object JS Fiddle or CodePen JSON [ { …
0
votes
1 answer

How can I check that a form has unsaved changes before closing ng-modal in Angular 5?

I have a modal popup. It has a form-group-like registration form. And it has fields like text, checkbox, select. If the user changes any form controls without saving the form, and then tries to close the modal popup, I would like to show a warning…
Kati
  • 51
  • 1
  • 6
0
votes
1 answer

How to vertically center modal dialog using ng-modal

Is it possible to to specify the modal-dialog-centered class somehow? There is an windowClass option for the outer element, but I don't see a way to specify modal-dialog-centered on the inner element.
Michael Gantz
  • 200
  • 2
  • 7
1
2