Have they fixed the issue with ng-options/select's ng-models value comparisons? A change with 1.4+ was to always have:
<option value="2">Two</option>
be === "2" as all underlying values are strings (fair enough) rather than == 2 as per <1.4. The problem is none of our non-string bound selects are binding anymore because 2 !== "2".
From == to === is a good change, but it seems the Angular team hasn't bothered to coerce the left-hand side of the expression into a string but has left that on us as devs to do it?! Really? So I have to change ALL of my APIs rather than the Angular team adding value + '' on the left?
I'm working on a major Australian government system that uses Angular and we are unable to upgrade past 1.3 currently because of this problem. Or have we managed to miss an easy fix for this issue?
Here's an extremely simplified example of the issue we're experiencing:
Angular 1.3 binds the select without issue, while 1.4+ does 2 === "2" et'al and of course doesn't find a match and leaves the select as blank. How have the rest of you guys fixed this in 1.4+?
We did, and I suggested the left-hand side coercion but was asked to raise another issue suggesting the change (which I have not yet done). Though I should now that I detailed it above... We tested thru 1.5rc2(?) and all versions past 1.3.9 were broken. Haven't tested 1.5 proper yet.
EDIT: Found it, and ng-options doesn't bind it either.
3
u/campbeln Feb 05 '16 edited Feb 05 '16
Have they fixed the issue with
ng-options/select'sng-models value comparisons? A change with 1.4+ was to always have:be
=== "2"as all underlyingvalues are strings (fair enough) rather than== 2as per <1.4. The problem is none of our non-string boundselects are binding anymore because2 !== "2".From
==to===is a good change, but it seems the Angular team hasn't bothered to coerce the left-hand side of the expression into a string but has left that on us as devs to do it?! Really? So I have to change ALL of my APIs rather than the Angular team addingvalue + ''on the left?I'm working on a major Australian government system that uses Angular and we are unable to upgrade past 1.3 currently because of this problem. Or have we managed to miss an easy fix for this issue?
Here's an extremely simplified example of the issue we're experiencing:
Angular 1.3 binds the select without issue, while 1.4+ does
2 === "2"et'al and of course doesn't find a match and leaves the select as blank. How have the rest of you guys fixed this in 1.4+?