BorisMoore / jsviews

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates
http://www.jsviews.com/#jsviews
MIT License
855 stars 130 forks source link

data-link="{on resetData}" syntax ? #335

Closed daslicht closed 8 years ago

daslicht commented 8 years ago

Hi, I found this line in the example code:

<button class="reset-btn" data-link="{on resetData}">Reset</button>

Where do I find more info about defining event handlers like this (eg by using on ?)

BorisMoore commented 8 years ago

There are a few features in JsViews that have so far only been documented by samples, not by real documentation topics. I am gradually adding topics, such as recent ones on $.views.settings, error handling, debug mode, full docs on unobserve, etc.

The {on ... } event binding is one still needing to be done, and I hope to get to it soon...

Meantime, you can search on jsviews.com some additional examples:

http://www.jsviews.com/#search?s=%7Bon%20

And also you can look at these unit tests, http://www.jsviews.com/test/unit-tests-jsviews.html?testId=c8fba23d,

Code here: https://github.com/BorisMoore/jsviews/blob/master/test/unit-tests/tests-jsviews.js#L8620 (or search for {on

BorisMoore commented 8 years ago

Closing this for now...