Now getting the angular 1.3+ one time bindings to work in my app, I had to do a lot of work. I just discovered today that my ng-ifs act weirdly with the bindings. Basically what I have often in my code, is something like this:
ng-if=" myUserData_shiftChanges[thisDay.dbFormat][siteIndex][groupIndex] && myUserData_basicData.id === userIndex"Now that works fine, when we don't involve one time bindings, but, when it changes to this:
::( myUserData_shiftChanges[thisDay.dbFormat][siteIndex][groupIndex] && myUserData_basicData.id === userIndex )It will create a watcher for this, eventhough it shouldn't.
I tracked the issue to angular handling ng-ifs that don't return something solid like true or false. I basically changed my code to one-line IFs, like so:
::( myUserData_shiftChanges[thisDay.dbFormat][siteIndex][groupIndex] && myUserData_basicData.id === userIndex ) ? true : falseAnd now they work fine again.
No comments:
Post a Comment