chieffancypants / angular-hotkeys

Configuration-centric keyboard shortcuts for your Angular apps.
http://chieffancypants.github.io/angular-hotkeys/
MIT License
1.68k stars 254 forks source link

Is this a AMD module? #286

Open ShashankDhasal opened 5 years ago

ShashankDhasal commented 5 years ago

I can only include AMD modules in my project. Is this AMD module? So I do this var hotkeys = require("../node_modules/angular-hotkeys/build/hotkeys.js");

and when I try to use it like

hotkeys.add({
                combo: 'up',
                description: 'this opens an alert box',
                callback: function () {
                    alert("It Works!!!!!!!!!!!");
                }
            });

i get an error hotkeys.add is not a function.

I console log hotkeys. In log it says mousetrap

Mousetrap(targetElement) {
        var self = this;

        targetElement = targetElement || document;

        if (!(self instanceof Mousetrap)) {
            return new Mousetrap(targetElement);

How can i use it using the require amd module