7 ms·
One of my friends had an interesting thought concerning the new syntax. He suggested the changes from the old syntax are based primarily around making it nearly
by orclev 12y ago
One of my friends had an interesting thought concerning the new syntax. He suggested the changes from the old syntax are based primarily around making it nearly impossible to work with jquery. E.G. how do you even make a jquery selector for something like "(click)="?
- idbehold 12y agoNot sure if this will work, but this is how you'd select based on an attribute: $("[(click)]")
- sanderjd 12y agoIt seems pretty crazy to me to want to do that. If you need to select that element, why not give it an id or a class? Angular attributes should be considered to be purely directions to the templating system.
- orclev 12y agoRight, that's the way you're supposed to use angular, but some people are lazy/bad/whatever and do crazy things with jquery either out of ignorance or because that's the way they're used to doing it. The thought was that they made this change to explicitly try to break people of the habit of falling back on a quick jquery hack rather than taking the time to do it right. This is of course pure speculation, I don't know if that's the reason behind the change or not, I just thought it was an interesting concept if that was in fact the reasoning behind it.