Skip to content
This repository was archived by the owner on Jan 17, 2022. It is now read-only.

Commit c3ac75d

Browse files
committed
Checking callback type
Checking callback parameter, allowing the use of ngIntroExitMethod without a callback function and no "callback is undefined" error
1 parent d18a884 commit c3ac75d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/angular-intro.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@
113113

114114
scope.ngIntroExitMethod = function (callback) {
115115
intro.exit();
116-
callback();
116+
if (typeof callback === 'function')
117+
callback();
117118
};
118119

119120
var autoStartWatch = scope.$watch('ngIntroAutostart', function () {

0 commit comments

Comments
 (0)