craftpip / angular-confirm

A multipurpose plugin for alert, confirm & dialog for angular1
http://craftpip.github.io/angular-confirm/
MIT License
115 stars 20 forks source link

Need scope.$apply in version 1.1.0 #12

Open Woodu opened 7 years ago

Woodu commented 7 years ago

On close function: if (typeof this.onClose === 'function') this.onClose.apply(this, [this.scope]); and in the setTimeout function: if (typeof self.onDestroy == 'function') self.onDestroy.apply(self, [self.scope]);

These two functions will not emit anything to angular,so some angular function calls in onClose or onDestroy will not work properly like: onDestroy: function () { $location.path($scope.backurl); return true; }

so I changed those code to: if (typeof this.onClose === 'function') { this.onClose.apply(this, [this.scope]); self.scope.$parent.$apply(); }

to call angular apply the changes.

craftpip commented 7 years ago

Thanks @Woodu can you please submit a PR for it