I am trying to find some examples on how to do a Confirmation modal dialog in Angular 2.0. I have been using Bootstrap dialog for Angular 1.0 and unable to find any examples in the web for Angular 2.0. I also checked angular 2.0 docs with no luck.
Is there a way to use the Bootstrap dialog with Angular 2.0?
Thanks!
try to use ng-window, it's allow developer to open and full control multiple windows in single page applications in simple way, No Jquery, No Bootstrap.
Avilable Configration
Here's a pretty decent example of how you can use the Bootstrap modal within an Angular2 app on GitHub.
The gist of it is that you can wrap the bootstrap html and jquery initialization in a component. I've created a reusable
modal
component that allows you to trigger an open using a template variable.You just need to install the npm package and register the modal module in your app module:
`
To show the backdrop, you'll need something like this CSS:
The example now allows for multiple modals at the same time. (see the
onContainerClicked()
method).For Bootstrap 4 css users, you need to make 1 minor change (because a css class name was updated from Bootstrap 3). This line:
[ngClass]="{'in': visibleAnimate}"
should be changed to:[ngClass]="{'show': visibleAnimate}"
To demonstrate, here is a plunkr