@Ramos: of course, I understand that Amber's script was necessarily
limited, but it did highlight an important gotcha with this kind of
scripting when used with web2py. And if all I wanted to do was hide a table
entry on click, I wouldn't want to pay the penalty of loading AngularJS to
do that. $(".target").hide() works fine. So I'm still looking for the angle
where AngularJS fits (no pun intended, but happy to make the pun anyway).
;-)
On Monday, May 12, 2014 6:15:37 PM UTC+8, Ramos wrote:
>
> Amber was only focused in showing how easy it is to create a better
> experience for the user using Angular than simple javascript.
> Also a lot less code for us, developers.
>
> It was just a simple demo. Of course that if the app was real and to be
> used by many, she could/should worry about keeping data in sync.
> And angular could fetch ajax data just like web2py components.I see no
> diference here. Its only a matter of taste.
>
> I could as well say that using only web2py,if i have 1000 users and
> everytime i need to hide a row in a table i need an http call, my server
> will die soon with all requests.. and for this angular is a perfect fit.
>
>
>
>
> 2014-05-12 3:28 GMT+01:00 weheh <[email protected] <javascript:>>:
>
>> +1 regarding the AngulaJS talk with web2py by Amber Doctor. Kudos to
>> Amber for a talk well given!
>>
>> I've been studying AngularJS a little and haven't written any code, yet,
>> but my web Spidey sense is giving off alarms. I think Amber's talk
>> underscores a potential danger of client-side MVC. First, correct me if I'm
>> wrong, but there's nothing in AngularJS that you can't already do in web2y
>> using components. The difference is that Angular does it client side
>> without needing to make an http call, so it potentially runs faster. And
>> AngularJS seems to have a more compact way of doing things we do in jQuery
>> with _onclick="blah blah blah" and other such
>> ajax("url",["target"],":eval"); or web2py_component(...) stuff.
>>
>> The danger highlighted by Amber's example is that Angular makes it much
>> easier to create a client-side model that gets out of synch with its
>> server-side web2py model. And keeping them in synch violates DRY
>> principles, requiring the http calls that you would have had to do anyway
>> if you did a web2py-component-only approach.
>>
>> For instance, if Amber's talk had been about a collaborative recipe app
>> and someone was updating the recipe database serverside while somebody else
>> was perusing the db clientside, then it would be easy for the clientside
>> user to get an out of date recipe and stay ignorant of that fact for a very
>> long time. That's because the local copy of the data is fetched only once
>> when the recipe is first clicked, assuming I understood her app correctly.
>> Further exiting and entering the recipe would not do an http call, whereas
>> the web2py component approach would naturally force an http call, thereby
>> keeping the user in synch.
>>
>> AngularJS seems to offer nifty, high-performance clientside business
>> logic ability. But unless structured carefully, it's not clear that it'll
>> save http calls without endangering synch between client and server. And it
>> could introduce even more complexity in terms of debugging and verbosity in
>> terms of supporting two MVCs for the same app. The thought of that makes me
>> wince.
>>
>> Anybody else have an opinion about this?
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.