Я новичок в Knockout.js.
Каков наилучший способ select() a <input />, когда он станет видимым?
Вид:
<p>
    Name: 
    <b data-bind="visible: !editing(), text: name, click: edit"> </b>
    <input data-bind="visible: editing, value: name, hasfocus: editing" />
</p>
ViewModel:
function PersonViewModel(name) {
    // Data
    this.name = ko.observable(name);
    this.editing = ko.observable(false);
    // Behaviors
    this.edit = function() { this.editing(true) }
}
ko.applyBindings(new PersonViewModel("Bert Bertington"));
http://knockoutjs.com/documentation/hasfocus-binding.html
Спасибо!