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 |
What is ag grid?
What are the attributes can be used during creation of a new angularjs directives?
What is pre-linking function in angularjs?
What an angular 5 component made of? How do you generate a new component?
How to set headers for every request in angular?
How to handle xss vulnerability scenarios in angularjs?
How to set http request header in angular 4 and angular 2?
How to enable html5 mode in angular 1.x?
What is context in angularjs?
What is the use of typescript in angular2?
Does angular js depends on jquery library?
What is ng-init in angularjs?