Live data from Hacker News

Using AngularJS at Localytics

localytics.com

21–30 of 59 posts

Re: Using AngularJS at Localytics

#21
post #20

My experience with Angular.js was not that good though. May be I am real dumb, I can't see anyone with similar experience. I was totally frustrated with the amount of things I had to handle to bind my backend API. And also there were several issues like $scope.variables going wild. In short, it was a total mess in my case. I rather decided to roll out with Jquery instead. The code got totally cluttered I accept, but…

Were you mixing dom manipulation into your controllers? That can make things go haywire because they happen outside the standard compile and link phase. Sometimes it works and sometimes it doesn't. Using the directives (which I admit are super confusing at first) can alleviate this issue because they are executed in the normal Angular update cycle so everything happens in the correct order.

Re: Using AngularJS at Localytics

#22

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 w…

100% agree. Single best angular resource on the web. Especially w/r/t his isolate scope explanations.

Re: Using AngularJS at Localytics

#23
post #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?

Honestly, there's not a huge amount of difference between Show Help $("#show-help-link").click(function() { showHelp(); } ); And Show Help I mean, HTML has behavior in it. A link in itself is "behavior": when you click this tag, go to the page defined in the src attribute. So, as the author says, it's not really a bad thing that templates have behavior in them. In Ember.js, for example, you have an {{action}} handler…

I think it's because needs evolved. When we went away from tables to use stylesheets, the goal was to keep the same html but alter the presentation with css and js (for the animations). But now, it's not just about presentation anymore. Real applications are built and maybe it doesn't make sense to keep the html and throwing away css/javascript on a full-rewrite. Basically, the html we code right now is way more tied to the javascript that it once was. So, having them in two separate files doesn't make that much sense.

Oh, and, you can use $('#show-help-link').click(showHelp); instead of click(function() { showHelp(); }); ! : )

Re: Using AngularJS at Localytics

#24

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…

Backbone has taught me a lot too, I like that it doesn't do any magic. Angular is pretty amazing though at how simple it is to do things with, I'm a bit worried about the magic part. What happens when things start growing and the magic breaks, do you have to read the code base to figure out where it went south? I started playing around with ember too. It's a bit tricky, I found I had to compile it to get it to work, the starter kit wasn't cutting the mustard for me.

Re: Using AngularJS at Localytics

#25
post #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?

The article did go on to say that there's no perfect place to put it but it still has to live somewhere. To expand on that, an event listener, by definition, is going to contain some DOM and some business logic. So no matter where you put your listener half of it will be out of place and reliant on some other code (attribute/function names) that may change in the future. Placing listeners in the DOM is the lesser of two evils simply because it is easier to write backwards compatible business logic/javascript than HTML.

Re: Using AngularJS at Localytics

#26
post #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?

This is my #1 complaint about angular - I keep hearing good things about it and going to try it, then I see markup like this and can't get myself to

Re: Using AngularJS at Localytics

#27

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 w…

I couldn't get your link to work, but it appears that his egghead.io videos are on his youtube channel.

http://www.youtube.com/user/johnlindquist

Re: Using AngularJS at Localytics

#28

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 w…

it is http://egghead.io alive ? It seems down at the moment.

Re: Using AngularJS at Localytics

#29

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 w…

I couldn't get your link to work, but it appears that his egghead.io videos are on his youtube channel. http://www.youtube.com/user/johnlindquist

Mike, thanks for the link. I just asked about egghead being down.

Re: Using AngularJS at Localytics

#30
post #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.

I think as mobile becomes more dominant angular will have to find a way to work tighter with the closure compiler in advanced mode (or something akin) to remain relevant.
Post reply on HN