Live data from Hacker News

Using AngularJS at Localytics

localytics.com

1–10 of 59 posts

Re: Using AngularJS at Localytics

#2
Good write up! I've been on the look out for examples of larger migrations from Backbone to Angular. I'm about to tackle one myself, but wanted to make sure it was the right decision before diving in.

Re: Using AngularJS at Localytics

#3
We've had a similar experience at https://starthq.com. One thing we noticed when writing directives is that it's often faster and easier to implement them from scratch rather than wrapping a jQuery plugin. Also, we've pushed a couple of fixes upstream and had them appear in a stable release within a few weeks due to the quick release cycle.

Re: Using AngularJS at Localytics

#4
I decided to use AngularJS on a side project of mine, after considering Backbone and EmberJS. I am not a JS expert, but I am pretty sure AngularJS will be an industry standard in a few years.

Re: Using AngularJS at Localytics

#5
Anyone thinking they made a mistake using Backbone, please read this: I've been using backbone for about 1 month, refactoring a huge jQuery spaghetti project, and I have few observations:

1) If you have a new project, I would go with Angular (or even Ember if you are from a Rails stack)

2) If you want to refactor an existing one, check Backbone, it might be a bit less causing a rewrite rather than a refactor

My tips if you still choose backbone:

- learn it first inside and out, spend at least 2 days doing any tutorial out there, even if it's a few dollars (code school, peepcode, tutsplus etc)

- make sure you learn 1.0, older examples might be confusing

- read the backbonejs.org documentation from start to end, and read the annotated source, especially read the FAQs and also read the github issues, jashkenas (the author) is sometimes responding himself

- I tried to avoid any plugins at first (no Marionette, deep model, BB-relational etc) if you see you need too many plugins, just ask youself if it's worth it, you might want to give Angular (or even Ember) a chance. I found out that for anything that looks hard, there is a way to do it in Backbone the "backbone way"

- Last: remember that Backbone is simply helping you get code from the form of document on load God function with tons of event listeners, that trigger ajax calls, that trigger dom manipulation, to about the same code, but in models and views, so you can make sense of all of it, that's all.

Yes, you need to clean up your listeners, and when using the 1.0 listenTo and stopListening (which are automatically called when you remove a view or destroy a model) then you are going to be ok with the zombies.

Backbone taught me a lot of JavaScript, it was more perhaps harder than Angular but the code is readable to anyone without even learning backbone, it just makes sense

so don't expect Backbone to do any magic, it doesn't, but it is still a very relevant and valuable utility library, and I think it's a must have step in any front end developer's life to do at least one BB app before moving to Ember or Angular (just my humble opinion)

Re: Using AngularJS at Localytics

#7
I have been working in the past few months with angular and have nothing but good things to say other than complaints about the docs and the complexity of directives/transclusion. He doesn't mention it but the coolest thing for me so far is the transparent use of promises in the templates. The unit testing support with testacular/karma is good as well, but I'm not sold on the e2e testing with angular-mocks, would like to hear more on this subject.

Re: Using AngularJS at Localytics

#9
For 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 which I found more often frustrating than illuminating, but John set me straight. Can't recommend enough.

And if you're struggling to ramp up on Angular, I would recommend sticking it out. The learning curve is steep (or is that gradual?--I never understood this analogy), but once it clicks, your productivity will go through the roof. Angular has redefined what I mean when I say "rapid prototyping."

Re: Using AngularJS at Localytics

#10
We 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?

Post reply on HN