Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Alloy: where to put events? xml or js

$
0
0

Hi,

couldn't find it in the Alloy Best Practices list so I quickly ask: What is the best place to put e.g. click events? Directly inside the xml:

<Button id="mybtn" onClick="clickFn"/>

or in the js:

$.mybtn.addEventListener("click",clickFN);

Should be the same after compiling or does it make any difference? If I put it in the xml it will save me one line in the js (cleaner code) but I have logic in the view-xml-file (so not all code/logic is inside the js-file). Any tips/recommendations?


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>