Closed sharmmoh1983 closed 6 years ago
Does Sonus.annyang.addCommands(commands) supports addition of resultNoMatch callback
You can add a command with just a splat (*
) to match all input. https://github.com/TalAter/annyang/blob/master/docs/README.md#examples-7
Based on your input , I am using splat like the following '()': function (command) { console.log('ha-command',command); scope.sendSocketNotification('ha-command', command); } But I am getting folllowing error Invalid regular expression: /^$/: Nothing to repeat
Without the parentheses:
var command = {
'*': function (command) {
console.log('ha-command',command);
scope.sendSocketNotification('ha-command', command);
}
I have tried this one also but giving same error regarding regular expression
var command = { '*': function (command) { console.log('ha-command',command); scope.sendSocketNotification('ha-command', command); }
Actually, the error that I have shared is because of the pattern you have shared
This seems to be the bug or I am not using it properly I want have a mapping for no match command
Hi I want to have a call back function when there is no match of commands .Is it posiible?