Let's suppose this custom directive mentioned in myHtml.tpl.html
:
<my-directive></my-directive>
This directive is initialized with an isolated scope.
Of course, I have a controller behind myHtml.tpl.html
.
I want to communicate a computed array from the isolated scope to the controller's scope.
I could have:
<my-directive arrayToCompute="arrayToCompute"></my-directive>
My isolated scope (in directive) being:
scope: {arrayToCompute: "="}
and my controller declaring this initially empty array:
$scope.arrayToCompute = [];
However, it seems pretty.....ugly..
What is a good alternative?
(I'm pointing out that I don't want to remove the scope isolation of the directive).