Perhaps this may help you.
@S.Klechkovski , . - .
, -, :
function appCtrl($scope, $compile) {
function onIntroAfterChange(targetElement, scope) {
angular.element(document.querySelector(".introjs-tooltiptext"))
.append($compile(
angular.element(
"<button my-directive>Test Directive</button>"))
(scope)).html()
}
$scope.onIntroAfterChange = onIntroAfterChange;
$scope.IntroOptions = {
steps: [{
element: "#step1",
intro: "Click the button:",
position: 'bottom'
}]
};
}
( ng-intro-onAfterChange )
, .
, . intro . ... (, , ):
JS:
angular.module("app", ["angular-intro"])
.directive("myDirective", myDirective)
.controller("appController", appCtrl);
function myDirective() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
console.log('you clicked the directive');
});
}
};
};
function appCtrl($scope, $compile) {
function onIntroAfterChange(targetElement, scope) {
angular.element(document.querySelector(".introjs-tooltiptext"))
.append($compile(
angular.element(targetElement).attr("data-template"))
(scope)).html()
}
$scope.onIntroAfterChange = onIntroAfterChange;
$scope.IntroOptions = {
steps: [{
element: "#step1",
intro: "Click the button:",
position: 'bottom'
}]
};
}
HTML
<body ng-app="app" ng-controller="appController">
<div ng-intro-options="IntroOptions" ng-intro-autostart="true" ng-intro-onafterchange="onIntroAfterChange">
<p id="step1" data-template="<button my-directive>Test Directive</button>">
Text
</p>
<button my-directive>Test Directive</button>
: - , , onIntroAfterChange $timeout. ,
PS: , IntroJS AngularJS. Libs , - .
PPS: , - , .
PPS: Angular