Accessing the data of the knockout related element

I am linking my element to ko and its working.

My requirement: I have that element which is related to ko,

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

How do I get the data?

+3


source to share


1 answer


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

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



You seem to be looking for a function ko.dataFor(element)

that returns data associated with an element.

+9


source







All Articles