2 Replies Latest reply: Mar 8, 2018 4:23 AM by Jesper Snihs RSS

    Use external js-plugin in extension

    Jesper Snihs

      I have an issue when trying to use a js-plugin (bootstrap-tour) inside my extension.


      The way to initiate the js-plugin on a regular website would be like the following at it works fine:

      var tour = new Tour({
        // Steps


      But when I import the plugin into the extension I'm not able to access the functionality in the same way.

      define( [
          function ( qlik, $, template, _bootstrapTour ) {
              return {
                  template: template,
                  support: {
                      snapshot: true,
                      export: true,
                      exportData: false
                  paint: function ($element, layout) {
                      return qlik.Promise.resolve();
                  controller: ['$scope', function ( $scope) {
                      var tour = new Tour({
                        // Steps


      It throws the following error:



      My guess is that it has something to do with this part of the code inside the plugin (I have remove a lot of code to give an easier overview):

      (function(window, factory) {
        if (typeof define === 'function' && define.amd) {
          return define(['jquery'], function(jQuery) {
            return window.Tour = factory(jQuery);
        } else if (typeof exports === 'object') {
          return module.exports = factory(require('jquery'));
        } else {
          return window.Tour = factory(window.jQuery);
      })(window, function($) {
        var Tour;
        Tour = (function() {
          function Tour(options) {}
          return Tour;
        return Tour;


      Any idea what I need to do to be able to access the Tour object inside the plugin?