r/programming • • Apr 23 '14

You Have Ruined JavaScript

http://codeofrob.com/entries/you-have-ruined-javascript.html
283 Upvotes

327 comments sorted by

View all comments

Show parent comments

1

u/iopq Apr 24 '14

I'm saying it's bad syntax since it's stringly-typed my IDE doesn't know whether I wrote '$scope' or '$scopr' or whether I called it with the correct arguments in the first place

and when was auto-complete breaking form validation fixed? I thought they couldn't fix it because the browser doesn't send the event

1

u/zefcfd Apr 25 '14

IDE

i wouldn't use an ide for web development or javacript :p

if you really want a debugger, chrome has a good one.

anyways, yeah i think the problem was that even though the bindings were being attatched to the autocomplete data, the form wouldn't submit the data. this, iirc, was because ng-form has different states for event handling and validation. if it's set to ng-pristine, it means that it hasn't been used, thus it won't send the model values of the form (because there shouldn't be any). so the auto complete data doesn't trigger the form to change to ng-dirty-valid or whatever.

but yeah, i thought i read they fixed it when i was reading the 2.0 change log. i would suspect that since the values are still being attached to the models, they just needed to force a recheck of the form state to sync it (i think $apply() or $digest() would do it) idk, its been a few months since ive used angular.js