I am trying to define a function in my html in order to use it as a callback for directive. I tried 2 ways:
1. in ng-init
<directive ng-init="foo=function(data){console.log(data);}" callback="foo"></dirctive>
2. in the attribute:
<directive callback="function(data){console.log(data);}"></directive>
for both i am getting an error.
Is it possible to do it without using the controller?