Al,

That is an good article. It is the way forward anyway. In angular 2.x there 
will be no ng-controller anymore, and you will have to work exclusively 
with directives.
As I said before, separating the business logic out is a good idea. What I 
meant is, there is no law that it must be inside services. If it makes more 
sense to wrap it into a directive, that might be a better option. As your 
directive can have it's own controller, there is little difference in 
testing. In this case the business logic belongs in the directives 
controller, which you can test separate from the directive. Actually that 
is also the core of the aforementioned article.

Another way to look at this is, you have multiple kinds of directives. some 
encapsulate DOM manipulation, some encapsulate event handling, some 
encapsulate templates, and some might encapsulate business logic. There are 
probably way more ways you can use directives.
Even sometimes the view-logic and the business logic are so entangled that 
it makes sense to put them in the same directive. Don't rule it out, just 
because you have read something about "best practices". Use your own 
judgement, and common sense.

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.

Reply via email to