I am using a bootstrap dialog to edit and create new elements. The function to open the dialog for creating a new element is invoked from a jQuery click handler, since this is being done by a 3rd party lib.
The function to open the dialog for editing an element is called via a directive.
Opening the dialog via the directive works fine every time. Also opening the dialog via the jQuery click handler works fine the first time, but when I close the dialog and try to open it again via the click handler it will not be opened until a click on the button with the directive is made and then both (the edit and the new item) dialogs are opened.
I made a simplified example here: http://plnkr.co/edit/HGvrqH?p=preview
What am I doing wrong?