Skip to content

Comment on Classy: Cleaner class-based controllers for AngularJS

Comments

I like this. One thing I like about is it how it sets up a canonical place to init things.

The other nice effect is the use of the injector instead of the repeated list of dependencies.

When not using coffeescript in angular, I could see making good use of this. Thanks !

It works really well with Coffeescript too. In fact it was written with Coffeescript and internally it uses Coffeescript's `Class` syntax.

It was originally inspired by this gist: https://gist.github.com/elado/8138516

I could see one annoyance being the lack of "fat arrow" in normal javascript and trying to reference the services in a callback.

AboutSource Built by g1lg1l

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