Giter VIP home page Giter VIP logo

Comments (5)

fpernia avatar fpernia commented on August 18, 2024

I have the same doubt that @shyamal890

from angular-intro.js.

farooqsah avatar farooqsah commented on August 18, 2024

you can create your directive and compile your directive in before change event.
*/directive
function tour() {
return {
templateUrl: "app/components/tour/templates/tour.html",
replace: true,
scope: {
totalResults: "=",
currentPage: "=",
title: "=",
content: "="
},
bindToController: true,
controller: TourCtrl,
controllerAs: "tour"
};
}

angular
.module("components")
.directive("tour", tour);

template
div class='popover-inner'>
h1 class='popover-title'>{{ tour.title }} - {{ tour.currentPage }} of {{ tour.totalResults }}</h1
div class='popover-content' ng-bind-html="tour.content"></div
div class="form form--horizontal">

/div>

/div>

steps
steps:[
{
element: '#step1',
intro: "div class='tourDirective' tour title='title' current-page='currentPage' total-results='totalResults' content='content'></div"
},
}

/**
* into after change
*
*/
function onIntroAfterChange(targetElement, scope) {
$timeout(function () {
var el = angular.element('.introjs-tooltip');
modalScope = scope.$new();
modalScope.title = data.title;
modalScope.currentPage = data.currentPage;
modalScope.totalResults = modalScope.ngIntroOptions.steps.length;
modalScope.content = data.content;
$compile(element.contents())(modalScope);
}, 500);
}

from angular-intro.js.

pavlokitdev avatar pavlokitdev commented on August 18, 2024

@farooqsah Is there a way to use directive as template without timeout 500ms?
It looks bad when after some timeout tooltip expands :(

Thanks!

from angular-intro.js.

farooqsah avatar farooqsah commented on August 18, 2024

@pavlokitdev unfortunately onIntroAfterChange doesn't works as expected so i had to use timeout.

from angular-intro.js.

varma-ksbh avatar varma-ksbh commented on August 18, 2024

Any updated solution to this issue?

from angular-intro.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.