Struggling for a good example of this.
I'm want to have a chart directive that will be updated every minute by polling a web service.
I currently have a service which is a wrapper for my web service. My controller can access this service and populate templates successfully. I have also created a chart directive which can display static data. I now want to make it possible for real time updating of this chart directive and potentially multiple charts on the same page. Should the polling logic therefore be inside the directive? I want every chart to be able to poll at different intervals.
A simplified example would of course be appreciated.
EDIT FROM COMMENT:
I would prefer to be able to add my directive like so:
<chart pollingperiod="12" param1="somevalue" param2="somevalue"></chart>
I think this would mean my directive would have to take the responsibility of the polling, or somehow pass these parameters to the controller to set up the polling.