Validation not triggered when data binding a number input's min / max attributes

前端 未结 5 1224
遥遥无期
遥遥无期 2020-12-01 08:29

I have numerous number input fields that have min and max attribute values that depend on logic elsewhere in my AngularJS app, but when using data bindings within these attr

5条回答
  •  余生分开走
    2020-12-01 09:02

    Apparently we can't use {{}}s (i.e., interpolation) for the min and max fields. I looked at the source code and I found the following:

    if (attr.min) {
      var min = parseFloat(attr.min);
    

    $interpolate is not called, just parseFloat, so you'll need to specify a string that looks like a number for min and max.

提交回复
热议问题