且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AngularJS 和 contentEditable 两种方式绑定无法按预期工作

更新时间:2023-02-27 07:43:07

问题是您在插值尚未完成时更新视图值.

The problem is that you are updating the view value when the interpolation is not finished yet.

所以删除

// load init value from DOM
ctrl.$setViewValue(element.html());

或替换为

ctrl.$render();

将解决问题.