angular.js, can't edit dynamically created input fields

后端 未结 3 2106
梦如初夏
梦如初夏 2021-01-02 00:58

Using angular.js, I have a dynamic list of form fields I want to display to the user for editing (and later submission):

var app = angular.module(\'app\', []         


        
3条回答
  •  旧巷少年郎
    2021-01-02 01:31

    It is editable but after each key press your text field losing focus so that you have to click on it again to put another char.

    And that happens because whole you template being re-rendered after each change in any of models. And after template re-rendered, currently there is no way to know which input should be focused. So you should create that way and you may want to write directive to hold focus on selected input.

提交回复
热议问题