Rajagopal 웃
Rajagopal 웃

Reputation: 8471

accessing data of the element which is bond to knockout

I have bind my element with the ko, and its working fine.

My requirement is i have that element which is bond to the ko,

Data is not available even getting like this $(elem).data()

How to get it's data?

Upvotes: 3

Views: 3693

Answers (1)

Mark Robinson
Mark Robinson

Reputation: 13278

Take a look at "Using unobtrusive event handlers" on the Knockout website:

http://knockoutjs.com/documentation/unobtrusive-event-handling.html

It sounds as though you are look for the ko.dataFor(element) function which returns the data that is bound against the element.

Upvotes: 9

Related Questions