How reset errors var/expresion on Bootstrap Modal hide event with AngularJS

92 views
Skip to first unread message

Porfirio Chávez G.

unread,
Jun 9, 2015, 8:45:36 PM6/9/15
to ang...@googlegroups.com

sorry for my primitive english, I don't have enough knowledge about language, Now the problem:

Please don't answer with Angular Bootstrap UI Solution

I have an Angular Directive with Modal, content one form (simple login), when I send the form I can receive a message (error, success, etc).

I want to "reset" error message variable on "modal hide event", this is for when you open the modal again don't display the last message, but I cant do that, maybe the scope or Isolate scope is the answer but i don't understand how to do it.

Important: The ID "MyModal" is for this example but the ID changes for different forms with other functions.

Now the code:

http://stackoverflow.com/questions/30736898/how-reset-errors-var-on-bootstrap-modal-hide-event-with-angularjs


Someone could help me ?

Sander Elias

unread,
Jun 11, 2015, 2:06:54 AM6/11/15
to ang...@googlegroups.com
Hi Elporfirio,

Well, you should start with dropping the bootstrapJS. This is making your job a lot easier. I created a small sample for you.
The sample is easily converted to a directive. 
I added an ng-if in the modal. That makes sure all controllers inside will get reinitialized when shown. 

Regards
Sander

Reply all
Reply to author
Forward
0 new messages