How to use the stimulus.Controller function in stimulus

To help you get started, we’ve selected a few stimulus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adrienpoly / stimulus-library-boilerplate / dist / index.js View on Github external
function _default() {
    _classCallCheck(this, _default);

    return _possibleConstructorReturn(this, _getPrototypeOf(_default).apply(this, arguments));
  }

  _createClass(_default, [{
    key: "greet",
    value: function greet() {
      this.outputTarget.textContent = "Hello, ".concat(this.nameTarget.value, "!");
    }
  }]);

  return _default;
}(stimulus.Controller);

_defineProperty(_default, "targets", ["name", "output"]);

module.exports = _default;
//# sourceMappingURL=index.js.map
github adrienpoly / stimulus-flatpickr / dist / stimulus-flatpickr.js View on Github external
};

  Flatpickr.prototype._boolean = function _boolean (option) {
    return this.data.get(option) === "true";
  };

  Flatpickr.prototype._array = function _array (option) {
    return JSON.parse(this.data.get(option));
  };

  Flatpickr.prototype._number = function _number (option) {
    return parseInt(this.data.get(option));
  };

  return Flatpickr;
}(stimulus.Controller));

module.exports = Flatpickr;
//# sourceMappingURL=stimulus-flatpickr.js.map
github adrienpoly / stimulus-conductor / dist / index.js View on Github external
return this[`${this._musicianName}Controllers`];
    }
  }, {
    key: "_conductorName",
    get: function () {
      return this.constructor.conductorId || `${this.identifier}s`;
    }
  }, {
    key: "_musicianName",
    get: function () {
      return this.constructor.musicianId || `${this.identifier.slice(0, this.identifier.length - 1)}`;
    }
  }]);

  return _default;
}(stimulus.Controller);

module.exports = _default;
//# sourceMappingURL=index.js.map
github adrienpoly / stimulus-flatpickr / dist / index.js View on Github external
try {
        return JSON.parse(val);
      } catch (e) {
        return val;
      }
    }
  }, {
    key: "flatpickrElement",
    get: function () {
      return this.hasInstanceTarget && this.instanceTarget || this.element;
    }
  }]);

  return StimulusFlatpickr;
}(stimulus.Controller);

_defineProperty(StimulusFlatpickr, "targets", ['instance']);

module.exports = StimulusFlatpickr;
//# sourceMappingURL=index.js.map

stimulus

Stimulus JavaScript framework

MIT
Latest version published 10 months ago

Package Health Score

81 / 100
Full package analysis