Setting ngTrueValue and ngFalseValue to numbers

前端 未结 4 581
轻奢々
轻奢々 2020-12-28 14:23

Update: question is obsolete for latest Angular version, see tsh\'s comment on this post


I have bound a checkbox to a value:

&         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-28 14:48

    HTML attributes do not have any types. They can not contain anything else, then a string, so it is always a string. End of story.

    You can not differentiate between between 1 and "1" in an HTML attribute. Angular tries to keep up with that, so only strings will work.

提交回复
热议问题