Can I make an Angular UI Bootstrap dialog block?

888 views
Skip to first unread message

Brett Wiesner

unread,
Apr 17, 2013, 2:53:35 PM4/17/13
to ang...@googlegroups.com
Hi,

I need to make a custom dialog be blocking. When the user does something I want to ask them whether they want to save, not save or cancel. While this dialog is up, I don't want anything else to happen. I've got a plunker which illustrates my problem...


As you can see the label reads "after modal closed" but that code is executed before the modal actually has been closed. How do I make this dialog block (stop exectuing other stuff) when it's opened?

Thanks,
Brett

Alan Hampson

unread,
Apr 17, 2013, 3:13:21 PM4/17/13
to ang...@googlegroups.com
You can't stop execution like that in Javascript. You can however add another .then() call on the end of the dialog call.

I've modified your plnkr, have a look at lines 29 to 32 in app.js

Brett Wiesner

unread,
Apr 17, 2013, 3:16:41 PM4/17/13
to ang...@googlegroups.com
Well now ain't that sneaky! Thanks Alan.

Thanks,
Brett
--

Brett Wiesner
VT MÄK, Director of New Product Innovation
150 Cambridge Park Drive, 3rd Floor, Cambridge, MA, 02140
T: +1.857.209.3471  Email: br...@mak.com 
labs.mak.com

Where Live, Virtual, and Constructive Simulation Meets the Web



--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/R67MQ2B9Btk/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages