How to open and close modal popup using typescript and bootstrap?



How to open and close modal popup using typescript and bootstrap?..

Answer / Brijesh Kumar

To create a modal popup in Angular using TypeScript and Bootstrap, you can follow these steps:n
1. Install the @ng-bootstrap/ng-bootstrap package.
2. Import the NgbModal and NgbModalConfig modules from the package into your component.
3. Define a modal component with an @Component decorator and inject the NgbModal service into its constructor.
4. Create a modal instance using the create method of the NgbModal service.
5. Open the modal by calling the open method on the modal instance, passing in the component that will be displayed inside the modal as well as any additional options such as size and backdrop configuration.
6. Close the modal by calling the dismiss or close method on the modal instance.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

What is ag grid?

1 Answers  


What are the attributes can be used during creation of a new angularjs directives?

1 Answers  


What is pre-linking function in angularjs?

1 Answers  


What an angular 5 component made of? How do you generate a new component?

1 Answers  


How to set headers for every request in angular?

1 Answers  


How to handle xss vulnerability scenarios in angularjs?

1 Answers  


How to set http request header in angular 4 and angular 2?

1 Answers  


How to enable html5 mode in angular 1.x?

0 Answers  


What is context in angularjs?

1 Answers  


What is the use of typescript in angular2?

1 Answers  


Does angular js depends on jquery library?

1 Answers  


What is ng-init in angularjs?

1 Answers  


Categories