¿Cómo puedo vincular un nuevo elemento create después de que la página se haya cargado?¿Cómo puedo unir elementos nuevos usando knockout?
que tienen algo como esto
system = function()
{
this.hello = function()
{
alert("hello");
}
this.makeUI = function(container)
{
div = document.createElement("div");
div.innerHTML = "<button data-bind='click: hello'>Click</button>";
}
}
ko.applyBindings(new system);
Si trato de este
this.makeUI = function(container)
{
div = document.createElement("div");
div.innerHTML = "<button data-bind='click: hello'>Click</button>";
ko.applyBindings(new system,div);
}
pero según theseposts que no va a funcionar.
He probado el violín anterior con su solución, pero ya no funciona. ¿Alguna idea? – guido
El enlace knockout.js en jsfiddles ya no funciona. Los actualicé para apuntar a un espejo CDN. Tratar; http://jsfiddle.net/ACjvs/75/ http://jsfiddle.net/qSqJv/84/ – MrTrick