Skip to content

Commit 19f5544

Browse files
committed
synchronized onexit and oncomplete with angular
1 parent ed92315 commit 19f5544

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/angular-intro.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ ngIntroDirective.directive('ngIntroOptions', ['$timeout', function ($timeout) {
3030
intro.setOptions(scope.ngIntroOptions);
3131

3232
if (scope.ngIntroOncomplete) {
33-
intro.oncomplete(scope.ngIntroOncomplete);
33+
intro.oncomplete(function() {
34+
$timeout(scope.ngIntroOncomplete.bind(this, scope));
35+
});
3436
}
3537

3638
if (scope.ngIntroOnexit) {
37-
intro.onexit(scope.ngIntroOnexit);
39+
intro.onexit(function() {
40+
$timeout(scope.ngIntroOnexit.bind(this, scope));
41+
});
3842
}
3943

4044
if (scope.ngIntroOnchange) {

0 commit comments

Comments
 (0)