Last post May 17, 2016 05:29 AM by Fei Han - MSFT
May 16, 2016 12:51 PM|sudip_inn|LINK
where do I put code, in ‘controller’ or ‘link’?”
just got a link
and full code is here http://plnkr.co/edit/k5fHMU?p=preview
just tell me when to put code in controller option and when in link option ?
May 17, 2016 05:29 AM|Fei Han - MSFT|LINK
In my opinion, we use controller when we need to share or reuse $scope data or we want directive interactive with each other.
link is used for DOM manipulation tasks.
This article compare the difference of controller and link in AngularJS directive with example, you could refer to it.
besides, you could check the "Creating a Directive that Manipulates the DOM" and "Creating Directives that Communicate" from this documentation.