<input type='number'> is auto incrementing. Bug?

北城以北 提交于 2019-12-10 17:22:38

问题


I think I have found a bug concerning the following binding: <input type='number'> when using a controller

html:

... {ctrl.i}} ...

dart:

... @NgController(...) class AController { int i = 5; } ...

When one modifies the input field, then there is an infinite loop (auto increment or auto decrement)

Note that this problem does not happen when using no-scope like in:

...
<input type="number" ng-model="i">
{{i}}
...

Is that a bug? Is there a way to use <input type='number'>?


回答1:


I tried it but couldn't get it to work with int but works fine with double class ACController { double i = 5.0; }.

type 'double' is not a subtype of type 'int' of 'value'.

EDIT
Same error in Angular '0.9.9' works only with double.




回答2:


There may have been a bug, but it appears to be fixed now.

I verified that this use cases work in AngularDart 0.9.10.



来源:https://stackoverflow.com/questions/20452207/input-type-number-is-auto-incrementing-bug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!