Isolated scopes has been discussed a lot, but I couldn't find a similar case.
I am using Angular in a website where the views are generated in PHP.
I have this kind of example of HTML content:
<my-directive>
<div ng-repeat="item in list"></div>
<ul>
<li>some information 1</li>
<li>some information 2</li>
<li>some information 3</li>
<li>...</li>
</ul>
</my-directive>
<my-directive>
<div ng-repeat="item in list"></div>
... // similar stuffs
</my-directive>
The list in "ng-repeat" is created from the content in the "ul" element which are populated in PHP in my HTML view.
If I don't isolate the scope, the "list" object in all my directive is the one from the last one.
If I isolate the scope, I can't access the list object in my directive (for my ng-repeat).
Usually scopes are injected in the directives but I have a lot of data from my list, so I can't just leave it as a params in my directive declaration.
Is there a correct way to do that?
[Edit]
I did a codepen to illustrate this issue:
http://codepen.io/laurent-le-graverend/pen/gljIa?editors=101.
In the JS code, if you try to remove the line 19, you will see that the filters appear, BUT it has the data from the last directive.