Closed trusktr closed 10 years ago
It's really up to you. Using Classy for a directive's controller was not a core use-case, it was more of an after-thought.
Personally, I put my main logic in the directive controller and then put DOM interactions in the link function. That's not necessarily more correct than putting your logic in the link function though. I certainly wouldn't go re-writing existing directives just so they can use Classy for the controller.
There will ultimately be Classy directives but I haven't decided what that will look like yet. If you have any ideas then you can add them to issue #1.
Suppose you have an app that uses directives extensively with logic mostly in the link functions, rather than in controllers. How would you recommend I bring classy into play? Should I use the
controller
property of the directive definition to define a Classy controller and move logic into there?