Skip to content

Instantly share code, notes, and snippets.

@oxsav
Created April 1, 2013 14:33
Show Gist options
  • Save oxsav/5285261 to your computer and use it in GitHub Desktop.
Save oxsav/5285261 to your computer and use it in GitHub Desktop.
that.listStatePresences = ko.observableArray([]);
getPresenca = function(){
eb.send("get.presence", {
"action": "get",
},
function(reply) {
console.log(reply);
if(reply.status=='ok')
this.listPresences(reply.reply);
else
console.log("Error" + reply.message);
});
}
listPresences = function(listpresences){
console.log(listpresences.length);
for (var i = 0; i < listpresences.length; i++)
listStatePresences.push(new Presence(listpresences[i]));
console.log(listStatePresences);
}
ko.applyBindings(this);
//HTML
<ul class="dropdown-menu" data-bind="foreach: listStatePresences">
<li data-bind="text: name"></li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment