Sightly-Javascript USE Implemetaion - Question
Hi All,
i am new to sightly.i understand that javascript USE class will be an server side programming. is there any way we can call an function written in javascript use file from sightly template? below is code which i am trying to but the call is not getting executed onclick. let me know how to achieve this kind of scenario
HTML:
<div data-sly-use.model="logic.js">
<button id="clear-completed" onclick="${model.addItemAction}"> Click
</button></div>
logic.js
use('/apps/todo/components/utils/filters.js', function (filters){
'use strict';
var model = filters;
function addItemAction() {
log.info("11111111111111111111111111111111111111111111111");
}
model.addItemAction = addItemAction();
return model;
});