This is a migrated thread and some comments may be shown as answers.

Reference to current item in a template

1 Answer 238 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Veteran
sitefinitysteve asked on 07 Dec 2012, 04:06 PM
Inside an MVVM bound template, how do I get access to the data item itself?

This doesn't give it to me (clearly eh) :)

<li data-bind="invisible: #= console.log(this) #">
    <span>test</span>
</li>

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 10 Dec 2012, 04:37 PM
Hello Steve,

It is actually called data. The following expressions are actually just the same:

#= data.PersonID #
#= PersonID #


All the best,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
MVVM
Asked by
sitefinitysteve
Top achievements
Rank 2
Veteran
Answers by
Petur Subev
Telerik team
Share this question
or