Live data from Hacker News

AngularJS Cheat Sheet [pdf]

dncmagazine.blob.core.windows.net

31–40 of 48 posts

Re: AngularJS Cheat Sheet [pdf]

#31
post #28

> 24. Wherever possible, use AngularJS versions of JavaScript functionality. So instead of setInterval, use the $interval service....It becomes easier to mock them or write unit tests I've always been very against these angular versions of basic js functions because it requires everyone on the team to learn them and it puts you even deeper into the angular lock in swamp, hindering you from eventually changing your vi…

Services like $timeout and $interval are basically just thin wrappers around their vanilla JS relatives(setTimeout and setInterval), there are more examples like this.

The APIs look identical, some with a little added functionality - but the primary reason for the AngularJS wrappers is that they'll automatically call $scope.$apply() for you, so that you don't have to do it yourself.

Re: AngularJS Cheat Sheet [pdf]

#32
post #9

This looks like a good resource. But number 28 is wrong: > Always have a ‘.’ in your ng-models which insures prototypal inheritance. That isn't what that does. The egghead.io Angular videos also get this wrong. I really think that the vast majority of Angular programmers don't really understand how its scoping works. I've ranted about this before [1], it's just ridiculously complex. Some scopes inherit prototypically…

Sheesh, I never got into angular because the "DI by parameter name" thing seriously bugged me but had no idea that the variable scoping in models could depend on the order that the inputs are used! How can people live with that?

Re: AngularJS Cheat Sheet [pdf]

#33
post #9

This looks like a good resource. But number 28 is wrong: > Always have a ‘.’ in your ng-models which insures prototypal inheritance. That isn't what that does. The egghead.io Angular videos also get this wrong. I really think that the vast majority of Angular programmers don't really understand how its scoping works. I've ranted about this before [1], it's just ridiculously complex. Some scopes inherit prototypically…

Interesting article, although I feel that some of your time may have been better spent submitting the changes you felt (like for documentation) as pull requests to help make it better, rather than just ripping on it.

Re: AngularJS Cheat Sheet [pdf]

#34
post #15

I love working with angular, but the intense competition from other technologies combined with the overall negativity towards it has turned me off. The long term future of angular seems very uncertain.

Angular 2.0 is the New Coke of web development. I suspect Google would gain a huge amount of goodwill if they backed down and announced: "You know, we'll rename the incompatible redesign as AngularNext 0.1 and use it to develop cutting-edge ideas. Then we'll bring the best of those into the mainstream Angular over time without breaking compatibility." They could call the rebooted compatible Angular 2.0 "Harmony".

You should spend some time watching some of the videos about Angular 2.0 from ng-conf, and you may see that there is much less reason for the opinion you have stated. The core team and some of the other presenters really laid out both a migration path going forward as well as the advantages Angular v2.0 will bring, and why they couldn't just do it on top of Angular 1.x.

Re: AngularJS Cheat Sheet [pdf]

#35
post #30

It'd be nice to see a UI Router cheat sheet in this format as well. I'm always forgetting nested syntax.

I would avoid investing too much in UI Router. As soon as the new Angular 2 router is available, it should be used for Angular 1.x projects as well to support migration to Angular 2 in the future.

Re: AngularJS Cheat Sheet [pdf]

#36

I love working with angular, but the intense competition from other technologies combined with the overall negativity towards it has turned me off. The long term future of angular seems very uncertain.

I mostly only see this overblown negativity towards Angular here on HN. It's bordering upon knee-jerk FUD.

Re: AngularJS Cheat Sheet [pdf]

#39
post #28

> 24. Wherever possible, use AngularJS versions of JavaScript functionality. So instead of setInterval, use the $interval service....It becomes easier to mock them or write unit tests I've always been very against these angular versions of basic js functions because it requires everyone on the team to learn them and it puts you even deeper into the angular lock in swamp, hindering you from eventually changing your vi…

I agree with you. It doesn't matter how thin the wrappers are or whether they preserve the API, the problem is all code is supposed to call them.

It's no problem to call $timeout in your Controller code or whatever, but what if you want to require a module that uses `setTimeout`? Either the module has to have some way of passing in the timeout function it should call, or you'd have to have a shim that monkey patches it or something.

Re: AngularJS Cheat Sheet [pdf]

#40
post #17
post #14

Earlier quoted context omitted.

> Whatever the reason is for Angulars popularity, it isn’t that it’s a great framework. Anything that makes programmers productive is a great tool. Angular 1.x definitely makes teams productive. It's one of the first web framework that comes with a specific testing framework. The clear separation between the DOM and the business logic makes apps more testable. And I could go for hours. Angular helps developers write…

I got tons of both hate and love for that blog post. One of the few criticisms that I can accept is the "The problems are real, but don't matter that much." view. I don't agree, but I suppose people can have different experiences there. Any 'sensationalism' comes from legitimate anger with the framework, after having spent over a year working with it on a large project. > Now your point about ng-model and scopes is v…

> after having spent over a year working with it on a large project

What issues are you running into? I always hear people complain about angular but rarely hear why.

Post reply on HN