简体   繁体   English

angular-hotkeys,如何覆盖梳状?

[英]angular-hotkeys , how to override comb?

I have one page which has simply save button and i set alt+s for that. 我有一个页面,它仅具有保存按钮,并且为此设置了alt + s。

hotkeys.bindTo($scope).add({
    combo: ['alt+s'],
    description: 'Collect Payments',
    callback: function() {
        $scope.collectPayment();
    }
});

Below that there is one add button. 在其下方有一个添加按钮。 when add button is presed one model is opened. 当按下添加按钮时,将打开一个模型。
On that model also have save button and i have to set alt+s for that also. 在那个模型上也有保存按钮,我也必须为此设置alt + s。

hotkeys.bindTo($scope).add({
    combo: ['alt+s'],
    description: 'Save Form',
    callback: function() {
        $scope.saveForm();
    }
});

How it isa possible ? 这怎么可能?
i tryed but main page key is lost. 我尝试过,但是主页密钥丢失了。

Fortunatly i find answer of this. 幸运的是我找到了答案。

When open model just delete all combs and initialize model combs. 打开模型时,只需删除所有梳子并初始化模型梳子即可。

and when close model reinitialize that main page combs. 并在关闭模型时重新初始化该主页梳。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM