December 2017
Beginner
372 pages
10h 32m
English
Like property binding, the syntax of event binding is also similar to HTML event binding, with the only difference being the event to which the binding happens.
So, in the case of HTML, you may have a click event which is then bound to a function in our component class. In NativeScript, there is a tap function, which does the same job as shown in the following code:
<WrapLayout class="board" on-tap="boardDetail(item)"> <Label [text]="item.title" class="title"></Label> <Label style="font-size: smaller" text="Total Task: {{item.task.length}}"></Label> </WrapLayout>As we can see in the first line, we have an on-tap event which is then bound to a function boardDetail method in our component class. If this had been written in HTML, ...
Read now
Unlock full access