Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    jQuery-only version of AngularJS's 'Todo app' - improvements?

    Hello all,

    First post in more than a year, yikes!

    I have been scratching the surface of AngularJS recently and their home page contains a simple app as an example of the framework's versatility. The app I'm talking about is the "Todo app".

    I decided to reverse engineer this app using only jQuery and here are my results.

    I'm pretty happy with the way it turned out. After some QA testing, it seems to operate in all the ways the AngularJS version does (in terms of functionality for the user, it does differ in how those processes are accomplished).

    Does anyone have some recommendations for how this jQuery app can be improved? The JS is not optimized yet, so I'm sure it can be truncated, but I was more so curious about potential improvements to the methodology used or perhaps adding some bells and whistles to improve on the basic app itself.

    Let me know what you think!

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,402
    Thanks
    11
    Thanked 595 Times in 575 Posts
    a few points and observations from 30,000 feet:

    it appears that you re-render all items just to change a single item, which could be problematic on an iphone1 with 5000 items...

    you could also lighten the load using classes instead of .css() inline styles.

    $('.unchecked').length replaces the counting loop in count list.

    you can loop through just, for example, $(':checked') in your reset functions, instead of all of the list items.

    it's also impossible to call these methods from the page because you don't export the functionality. this makes it hard to call, say, addTodo() using anything except your buttons.
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •