Skip to content

Commit

Permalink
Added $compile for the step's html so that ng-click works (#33)
Browse files Browse the repository at this point in the history
* Added $compile for the step's html so that ng-click can be used inside the help text.
  • Loading branch information
bmartinelle authored and lebolo committed Jun 29, 2016
1 parent b248ad7 commit 6688234
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
20 changes: 12 additions & 8 deletions dist/nz-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@
service.current = false;
if(func) {
return func();
}
return true;
} else {
return true;
}
});
}

Expand Down Expand Up @@ -175,7 +176,6 @@
service.cleanup();
}, service.current.tour.config.animationDuration);
}
// return $q.when(null);
}

function doStep(direction) {
Expand Down Expand Up @@ -219,8 +219,9 @@
service.current = false;
if(func) {
return func();
}
return true;
} else {
return true;
}
});
}

Expand Down Expand Up @@ -258,7 +259,7 @@
}
}]);

module.directive('nzTour', ["$q", function($q) {
module.directive('nzTour', ["$q", "$compile", function($q, $compile) {
return {
template: [
'<div id="nzTour-box-wrap">',
Expand Down Expand Up @@ -496,8 +497,11 @@
showNext: steps[step].showNext === undefined ? config.showNext : steps[step].showNext,
showPrevious: steps[step].showPrevious === undefined ? config.showPrevious : steps[step].showPrevious
};
//Don't mess around with angular sanitize for now. Add compile and sanitize later...
els.innerContent.html(steps[step].content);
var stepHtml = steps[step].content;
// Compile the step definition html so ng-click works as expected.
var compiledHtml = $compile(stepHtml)($scope);
els.innerContent.html(compiledHtml);

// Scroll Back to the top
els.content.scrollTop(0);

Expand Down
Loading

0 comments on commit 6688234

Please sign in to comment.