javascript - Passing function into angular directive -


i want pass function returns promise directive. doing follows:

callback created in parent controller:

$scope.mycb = function(data) {    console.log(data); } 

scope of directive:

scope {     datacallback: "&" } 

it being passed directive follows:

<my-directive data-callback="createcallback"></div> 

and being called in directive controller follows:

$scope.datacallback(data) 

where data local variable.

currently not working. $scope.datacallback returning parentget(scope, locals) , not executing of code inside of function.

can point me in right direction?

https://plnkr.co/edit/ycgfpurlt2mfuppi1lzj?p=preview

solved:

can not use data start of directive property.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -