On Saturday, July 18, 2015 at 5:18:32 AM UTC+2, Hengkeat Yam wrote: > > no, that not working well , because i can't write an async method > callback by angular expression. > ng-click="resource.$saveAsync(); showForm = false;" > the "showForm = false" will execute immediately, no waiting for the async > callback. > any idea ? > Yes, do it in the controller :-P If you make the showForm=false a function of the controller, you might be able to do the .then in the template.
> But that is a bit too much logic into the template for my opinion <-- > For me It is still acceptable, just two action save and close. > Because i often change my template design and the event action. So i move > some logic into template , let the view can be more flexible. > But it isn't 2 actions is it? you want to wait for a promise to clear too right? And what if the promise rejects? Sure, you can fork all of this over to the template, but maintaining such a thing will become more and more challenging. Regards Sander -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
