Friday, 15 January 2010

knockout.js - knockout data-text binding with limited character in mvc4 -



knockout.js - knockout data-text binding with limited character in mvc4 -

i have knockout data-text binding. want show limited character in view. tried, doesn't work. here attached code. can 1 please check code , help ???

this code

<span data-bind="text: (description.length > 10 ? description().substring(0, 10) + '...' : description)"></span>

i can't see duplicate answer, work, you're missing parenthesis description check length. description().length

<span data-bind="text: (description().length > 10 ? description().substring(0, 10) + '...' : description)"></span>

see js fiddle

knockout.js

No comments:

Post a Comment