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(); }
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.