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

Interpolation issue #260

Open jbthummar opened 7 years ago

jbthummar commented 7 years ago

In my app I am usign [[ ]] as interpolation symbols but angular-hotkeys is using {{ }} symbol in template. So not able to see help text dialog properly.

aramando commented 7 years ago

@jbthummar You can set a custom template for the cheat sheet so you can change the interpolation symbols used. Something like this ought to do it:

angular
    .module('myApp', ['cfp.hotkeys'])
    .config(function($interpolateProvider, hotkeysProvider) {

        // presumably you already have something like this in
        // your app to set the custom interpolation symbols:
        $interpolateProvider.startSymbol('[[');
        $interpolateProvider.endSymbol(']]');

        // so just modify the default cheat sheet template to use your customised symbols:
        hotkeysProvider.template = hotkeysProvider.template.replace(/{{/g, '[[').replace(/}}/g, ']]');

    });