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?
solved:
can not use data
start of directive property.
Comments
Post a Comment