I have a directive with refresh scope. In my case refresh should be an object or a function, so how can i assign this to my directive.
1. First case
<!--HTML-->
<directive
refresh="vm.refresh">
</directive>
//JS
scope:{refresh:"="}
2. Second case
<directive
refresh="vm.refresh(search)">
</directive>
//JS
scope:{refresh:"&"}
3. My case
<directive
refresh="vm.refresh or vm.refresh(search)">
</directive>
//JS - What to do ? need help
scope:{refresh:"=&needHelp"}
But i need this both features in my directive, So how can i isolate this both. I need to know applied refresh scope is object OR function in link function of directive.
refresh="vm.refresh"?=the first case will result into function that can be called from directive - ok, but the second case will beundefined(because it will be executed during parse phase) - totally not what we want.