HA! I was just coming back to here to say that I had just read a post on 'componentizing' by pairing directives with controllers. This will be my 4th project with Angular, so I'm still in the figuring it out phase.
http://teropa.info/blog/2014/10/24/how-ive-improved-my-angular-apps-by-banning-ng-controller.html I think this will solve for me what has become a chicken&theEgg problem where each new directive required a new controller which used directives and so on. It was inspiring also to see his use of angular.module to contain the parts that made up the module. I've read some posts on how absolutely banning business logic from the presentation layer makes it much easier to test the business logic using karma [for instance] without having to fire up protractor to do an e2e test just to cover all your business logic. Also it makes your presentation layer objects more re-usable Al; On Tuesday, February 10, 2015 at 9:32:04 AM UTC-5, Sander Elias wrote: > > Hi Al, > > You do know directives can have controllers do you? If I say directive, > most of the times there will be an associated controller. You can inject > whatever you need in this controller. > I do agree that business logic should be as separate as possible. Putting > it in services is a good thing. However, in some cases the logic and the UI > is very close coupled. In this cases an Bossiness logic directive might be > an option. > > Regards > Sander > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
