News for hackers. Stuff that matters.
Re:AngularJS: A Retrospective by warfangle on Wednesday March 26, 2014 @11:29AM (#7474042)
When you use an unblessed language derivative like Coffeescript for your examples, please give alternate examples (even if they are simply generated by your coffeescript translator). Especially in this case, since Angular isn't targeted specifically at Coffeescript developers.
Re:AngularJS: A Retrospective by vkjv on Wednesday March 26, 2014 @01:01PM (#7474709)
Not to mention that it saves a whopping 4 lines here. There aren't any CoffeeScript specific features used here, so why use it at all?
Re:AngularJS: A Retrospective by thoughtpalette on Wednesday March 26, 2014 @12:13PM (#7474396)
I agree. Took me a second looking at the example then realizing it was coffee script. Not as helpful to me.
Re:AngularJS: A Retrospective by lucisferre on Wednesday March 26, 2014 @12:13PM (#7474399)
Is this just an anti-coffeescript rant or are you actually struggling to follow the examples?
Re:AngularJS: A Retrospective by awj on Wednesday March 26, 2014 @12:33PM (#7474544)
I think it's a legitimate concern about the ability to read examples. Using nonstandard tools to showcase a concept limits the people who are able to follow along. Not everyone has invested the time to learn the ins and outs of CoffeeScript, why hinder understanding with it when "talking about CoffeeScript" isn't the point of the article?
Re:AngularJS: A Retrospective by ulisesrmzroche on Wednesday March 26, 2014 @01:15PM (#7474804)
It's really not a big deal in this case. Code is not doing anything tricky. Just add some ugly curly braces and parenthesis and it's es6 JS with the arrow.
Re:AngularJS: A Retrospective by lucisferre on Wednesday March 26, 2014 @06:53PM (#7477248)
No, it's a tired complaint from a group of people who don't like the idea that people are building for the web in something other than their favourite language.

No one is forcing you to like coffeescript, but it's completely unnecessary to complain about every single example or blog post that uses it.

Re:AngularJS: A Retrospective by PascalW on Wednesday March 26, 2014 @12:22PM (#7474465)
Nice article but IMHO it's missing the most important pieces of a retrospective, e.g. "what went wrong" and "what can be improved".
Re:AngularJS: A Retrospective by lucisferre on Wednesday March 26, 2014 @12:23PM (#7474477)
Yeah I was hoping for a little more insight. This was mostly a brief tour.
Re:AngularJS: A Retrospective by j_baker on Wednesday March 26, 2014 @12:47PM (#7474622)
> When starting out, forgo writing directives. You need a deep knowledge of AngularJS' internals to debug directives when they misbehave. Instead, start by writing a small controller and view. You can refactor these into a directive later when it feels right.

No. Controllers should not be used for DOM manipulation. Angular directives take some learning, but they're great. It basically turns DOM node selection into a matter of Dependency Injection. I think it's an exaggeration to say that directives require "deep knowledge of AngularJS' (sic) internals".

Re:AngularJS: A Retrospective by acconrad on Wednesday March 26, 2014 @02:05PM (#7475147)
Exactly, and this is echoed by the Angular development team (http://docs.angularjs.org/guide/controller).
Re:AngularJS: A Retrospective by vedant on Wednesday March 26, 2014 @12:53PM (#7474664)
Why the "(sic)"? Is "AngularJS" not the preferred stylization?
Re:AngularJS: A Retrospective by mattwad on Wednesday March 26, 2014 @01:00PM (#7474701)
not sure if it's what he meant, but the correct possessive should be AngularJS's
Re:AngularJS: A Retrospective by geuis on Wednesday March 26, 2014 @12:13PM (#7474395)
One of the few places where Angular falls down is its use of a single ng-view. This makes doing something as simple as a two column layout frustratingly more complicated than it should be.

Use ui-router. It allows multiple views and uses states for URL routing. It's a little tricky to understand at first, but once you internalize how states work it makes structuring your app very easy. Be prepared to rewrite parts of your projects multiple times until you actually get it.

Re:AngularJS: A Retrospective by lucisferre on Wednesday March 26, 2014 @12:18PM (#7474434)
There's also this project: http://angular-route-segment.com/

The $resource service is also not as well designed as it could be. I'm thinking of moving to restangular.

Re:AngularJS: A Retrospective by saurabh on Wednesday March 26, 2014 @12:30PM (#7474526)
I am using Restangular & ui-router in a project I am working on currently and its working great. Highly recommended.
Re:AngularJS: A Retrospective by AdrianRossouw on Wednesday March 26, 2014 @12:16PM (#7474423)
I think angular's future is more interesting than it's past or present.

getting rid of the dirty checking? yes please. etc..

Re:AngularJS: A Retrospective by keda on Wednesday March 26, 2014 @02:53PM (#7475545)
I think it's miss-using the service in this example. The example should be using factory: .factory('RemoteResource', function($http){ return {retrieve: function(){ $http.get("url"); }} })

Service should be like this: .service('RemoteResource', function($http){ this.retrieve = function(){ $http.get("url"); } })

See Stackoverflow: http://stackoverflow.com/questions/15666048/angular-js-servi...

Re:AngularJS: A Retrospective by udfalkso on Wednesday March 26, 2014 @11:45AM (#7474188)
A factory vs. service example would help the article out some.