Skip to content

Comment on Classy: Cleaner class-based controllers for AngularJS

Comments

There's a lot of conversation about the redundant injector syntax in this thread. This is something that ngmin takes care of completely transparently. There's really no need to worry about it in raw, uncompressed source code. Other than that, this provides a nice way to enforce a certain set of conventions, but I'm not completely sold on the quality of those conventions - the most glaring thing being losing references to your watches. Reverse-binding controllers to views through DOM selectors also has a bad code smell IMO, feels a bit like reverting to jQuery madness. I prefer to do this through routing or directives wherever possible.

ngmin isn't really a solution, it's a post processing transpiler hack. There's lot of ways to format your js code so that ngmin does the wrong thing and destroys working code. I wouldn't call the problem 'solved'. At least not until angular 2.0 or a solution like this.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.