I approach him.
Directives contain browsing logic, not business logic. This also happens when DOM-messing occurs, if necessary.
The controllers are pretty thin, have minimal business logic.
Angular Services where most of the heavy lifting is done.
If you have logic that needs to be reused by several areas / controllers or is well-founded - perhaps it is better suited for use in the Service than in the Directive.
Depending on your application / architecture, you can send messages to the server and have a heavy BL on the server side.
There is a nice bit to Angular docs on Correctly using directives , which has a few pointers.
e82
source share