davej / angular-classy

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

Some suggestions #27

Closed ghost closed 10 years ago

ghost commented 10 years ago

Hey guys,

thanks for this small framework, pretty useful. Just some suggestions based on my usage experience:

  1. If I my parent angular module depends on 'classy', I don't want my child modules also depends on 'classy'. It repeats the code, doesn't make sense at all.
  2. module.classy.controller() should return the module itself, so that I can write code like this: module.classy.controller(xxx).config(xxx).run(xxx)
  3. I would like to add more controllers at one time, please add a new interface like module.classy.controllers([xxx]) and return the module it self, so that I can write code like this; module.classy.controllers([xxx, xxx]).config(xxx).run(xxx).

thanks,

davej commented 10 years ago

Thanks!

  1. I am refactoring this area of Classy for 0.5. If you could give me some code to run a test case against then it would be super helpful.
  2. See issue #13 for the reason Classy doesn't do this.
  3. Hmm, that sounds like a good idea.

Thanks for the suggestions! Could you possible create separate issues for 1 and 3 to make it easier for me track decisions/development?

ghost commented 10 years ago

thanks @davej for your work! It's really helpful.

For the first issue, I currently can only provide some pseudo codes. var parentModule = angular.module('parentModule', ['classy']); var childModule = angular.module('childModule', ['parentModule']); expect(childModule.classy.controller('xxx')).not.throwError();

davej commented 10 years ago

Closing, because this is split out into #28 & #29.