davej / angular-classy

Cleaner class-based controllers with Angular 1
http://davej.github.io/angular-classy/
813 stars 27 forks source link

BindDependencies plugin, possibility to not to define inject property #23

Closed juangabreil closed 10 years ago

juangabreil commented 10 years ago

Hi again!

Right now, it looks a bit strange not to define 'inject' property but in the future defining services or directives could not be necessary to define it.

The problem is that if you don't define 'inject' the var __classDepNames is undefined and breaks the execution at init time. I would suggest to initialize depNames using a default value fallback when classObject.inject is undefined, something like: depNames = classObj.inject || {}

Regards

davej commented 10 years ago

Again, great catch, I'll fix this.

I think the code related to this area of Classy is a bit confusing. I'm considering dropping support for named dependencies to make the code a bit cleaner. Any thoughts?