<input type='number'> is auto increm

2019-07-04 16:16发布

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'>?

2条回答
家丑人穷心不美
2楼-- · 2019-07-04 16:34

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.

查看更多
The star\"
3楼-- · 2019-07-04 16:50

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.

查看更多
登录 后发表回答