Stepping Backwards from AngularJS to JQuery – An Experiment
21–30 of 68 posts
Re: Stepping Backwards from AngularJS to JQuery – An Experiment
#22I think there's a better approach to handling the delete buttons that's pretty common when using jQuery. Instead of each button having it's own handler function I would specify an event handler on a single DOM element (e.g. a list container) with something like $('#itemlist').on('click', '.delete', deleteItem). When 'deleteItem' is called 'this' will be the clicked button element that could have an attribute like 'da…
Re: Stepping Backwards from AngularJS to JQuery – An Experiment
#23Routing, view, controllers in 60 lines of code + jQuery: https://github.com/c-smile/spapp
Template-less repeatable sections / lists in 100 lines of code + jQuery: https://github.com/c-smile/repeatable.
Re: Stepping Backwards from AngularJS to JQuery – An Experiment
#24Giving up Angular did force me to think more about the DOM. Vanilla jQuery doesn't insert itself as readily into HTML code as an Angular directive can. And that's why you should use http://intercoolerjs.org for most of your stuff, and a bit of jQuery where necessary for more exotic UX needs. The people who got sick of a mess of jQuery code were right, but they went the wrong direction to fix it. We have to go back. I…
I would encourage you to tone down your rhetoric a bit, though. Intercooler looks like a good lightweight tool for projects with lightweight requirements, but based on your own documentation, the claim that it covers most of what is needed for most modern web apps just hurts your credibility.
Re: Stepping Backwards from AngularJS to JQuery – An Experiment
#25You can use event delegation for button handling : `$(document).on('click', '.button-list', my_function);` https://learn.jquery.com/events/event-delegation/
Re: Stepping Backwards from AngularJS to JQuery – An Experiment
#26Caveat: novice programmer here. Even Angular is still difficult for me to grok and sometimes I wonder if stuff that comes out of Google "suffers" (for me) from Google having unlimited resources and employing superior engineers? Would Google have a difficult time empathizing with "average" programmers with limited resources?
Angular is difficult to grok because it makes computer programming second class and limited to what you can cram into HTML tags. Angular isnt really a Google product - Misko Hevery and another guy (both Google SW Engineers) developed in their free time. Dart is a Google product and I would say is much easier to grok than Angular.
...say what? I've done a lot of work with Angular, and a lot of work without it, and it's possible that I might agree with what you're saying here if I understood it, but I don't. Can you elaborate?
Re: Stepping Backwards from AngularJS to JQuery – An Experiment
#27Caveat: novice programmer here. Even Angular is still difficult for me to grok and sometimes I wonder if stuff that comes out of Google "suffers" (for me) from Google having unlimited resources and employing superior engineers? Would Google have a difficult time empathizing with "average" programmers with limited resources?
I used Mithril for a while and it opened up my eyes as far as thinking "functionally"; it makes your code easier to understand and extend.
If you use filters functionally with Angular, you can get great performance on large collections in a ng-repeat. Likewise, if you understand prototypical inheritance, it will make working with multiple controllers/states a lot easier.
I really enjoy developing Angular, but it took a lot of time to really process. jQuery just works out of the box, but for me, it feels like it is more for little snippets of codes across various pages. It just depends on what you are trying to do.
Re: Stepping Backwards from AngularJS to JQuery – An Experiment
#28I found this interesting because it seems to have been written by a person who learned Angular before jQuery. I haven't run into that before. Maybe I'm getting old.
Well, I actually learned Angular 2 before I learned Angular 1.
I'd have to guess you left Angular2 to go back to Angular1 considering the current state of development
Re: Stepping Backwards from AngularJS to JQuery – An Experiment
#29I found this interesting because it seems to have been written by a person who learned Angular before jQuery. I haven't run into that before. Maybe I'm getting old.
Re: Stepping Backwards from AngularJS to JQuery – An Experiment
#30Giving up Angular did force me to think more about the DOM. Vanilla jQuery doesn't insert itself as readily into HTML code as an Angular directive can. And that's why you should use http://intercoolerjs.org for most of your stuff, and a bit of jQuery where necessary for more exotic UX needs. The people who got sick of a mess of jQuery code were right, but they went the wrong direction to fix it. We have to go back. I…