Get array value in html by knockoutjs

brooksworm

New Member
I am getting value from an array like below:\[code\]self.users = ko.computed(function(){var list = ko.utils.arrayMap(self.tasks(), function(item){return item.members + item.skype});var val = ko.utils.arrayGetDistinctValues(list);alert(val);return val;});\[/code\]Its showing values like:\[code\]user1skype_user1, user2skype_user2\[/code\]But my problem is i need to show this value in html inside foreach loop of users. My html code is below:\[code\]<tbody data-bind="foreach: users"><tr> <td> <b><span data-bind="text: //membername" /></b> </td> <td> <span data-bind="text : //skypeid"></span> </td> </tr>//another fareach loop</tbody>\[/code\]I have created jsfiddle by taking another appraoch. but its repeating according to tasknos.jsfiddle in another approach
 
Back
Top