I am facing a specific scenario with my directive where the refresh scope needs to be either an object or a function. How can I properly assign this to my directive?
1. Initial scenario
<!--HTML-->
<directive
refresh="vm.refresh">
</directive>
//JS
scope:{refresh:"="}
2. Alternative scenario
<directive
refresh="vm.refresh(search)">
</directive>
//JS
scope:{refresh:"&"}
3. My current situation
<directive
refresh="vm.refresh or vm.refresh(search)">
</directive>
//JS - Unsure what to do, need assistance
scope:{refresh:"=&needHelp"}
However, I require both of these functionalities in my directive. So how can I segregate and differentiate between an object and a function within the link function of the directive?