Using AngularJS at Localytics
51–59 of 59 posts
Re: Using AngularJS at Localytics
#52We used to write things like Then we realized it was bad to couple presentation and behavior, so we made our Javascript unobtrusive, keeping our templates clean. But now we’re back at it again, writing . Have we learned nothing? --- This seems like a good point that I can't refute - anyone?
For documents.
Applications are not documents.
Re: Using AngularJS at Localytics
#53Re: Using AngularJS at Localytics
#54For those commenting on the poor quality of Angular's documentation (a complaint I share), check out John Lindquist's videos at http://egghead.io/ . They're not comprehensive, but John spends a great deal of time explaining the nuances of directives, especially isolate scopes and transclusion and his explanations are clear and intuitive. Prior to finding John's videos, I watched all of the "official" Angular videos w…
it is http://egghead.io alive ? It seems down at the moment.
Re: Using AngularJS at Localytics
#55- Directives : I'm no JS ninja so even after those egghead.io I'm still lost, but it gets better !
- jQuery : Angular kinda want to kill it whereas I think it should play nicer with it, especially for plugins. AngularUI jQuery Passthrough (or custom directives) should not be necessary IMO.
- Expressions : they are powerful but there is almost no documentation about them and I feel like an idiot sometimes. Thank god for Stack Overflow ... (where in the Angular doc can I learn that I can do ng-click="[action_1, action_n]" ?).
- Views helpers are usually put in the controller. That doesn't seem the best approach, or maybe people put them in a service and inject it in the scope from the controller ?
- Providing initial data : I usually put data in javascript variables and get them in the controller and assign them to services or the scope. Is there a better way ?
Re: Using AngularJS at Localytics
#56The blog author's problem was a brief bug that was introduced and fixed between releases for the rare use case when a data-bound view is re-rendered. We fixed this problem and the author confirmed that the patch was "working great."
https://github.com/NYTimes/backbone.stickit/issues/66
So even though the problem was fixed for the blog author before he moved onto angular, he still claims that stickit causes memory problems. I guess a false claim like that makes the story of moving to a new framework more entertaining.
Another claim from the blog author is that stickit makes it hard to use third-party plugins like Chosen. Around the same time he filed the github issue, we were finishing and getting ready to release "handlers" and a new "initialize" binding which give you the ability to create global handlers for setting these kinds of bindings up. More on handlers here:
http://nytimes.github.io/backbone.stickit/#custom-handlers
... and an example of setting up a global handler for Chosen:
Re: Using AngularJS at Localytics
#57Earlier quoted context omitted.
why?
I'm not sure why the OP links advance compiling specifically to mobile. It's good to have smaller, faster code on any platform that isn't quad Xeon with a fiber connection. The Closure ecosystem has their own templates (soy) which are compiled in Advance Mode (with renaming) by the Closure Compiler. It's not possible to do that with Angular attribute's which reference JS names. See this conversation about Angular sup…
Re: Using AngularJS at Localytics
#58We used to write things like Then we realized it was bad to couple presentation and behavior, so we made our Javascript unobtrusive, keeping our templates clean. But now we’re back at it again, writing . Have we learned nothing? --- This seems like a good point that I can't refute - anyone?
ng-click="doSomething()" runs doSomething() in the scope of the controller that contains the element. Good!
Re: Using AngularJS at Localytics
#59We used to write things like Then we realized it was bad to couple presentation and behavior, so we made our Javascript unobtrusive, keeping our templates clean. But now we’re back at it again, writing . Have we learned nothing? --- This seems like a good point that I can't refute - anyone?
The alternative is a slew of loosely-coupled and opaque attributes (IDs and classes), especially where you're not sure if a particular class or ID is used for presentation (CSS) or functionality (JS). How do you handle refactoring when you use some classes for JS and some for CSS? With custom attributes there is no confusion, and although it goes completely against the separation of concerns and now your mark-up isn'…
pBlue bWidget?
I've never done this, just wondering.