Closed kayvanbree closed 5 years ago
We should be able to pass arguments to a function somehow.
Maybe like this:
const context = [ { text: 'Yellow square', context: ['item'], action: (itemNr: number, message: string) => { console.log(`Item nr ${itemNr} says: ${message}`); }, hotkey: 'y' } ];
Then in the html we can loop through stuff and add ctx-args:
<ul> <li ctx="item" ctx-args="{itemNr: 1, message: 'Hello!'}">Item 1</li> <li ctx="item" ctx-args="{itemNr: 2, message: 'Good morning!'}">Item 1</li> </ul>
We should be able to pass arguments to a function somehow.
Maybe like this:
Then in the html we can loop through stuff and add ctx-args: