I am using ng-include src
directive at multiple places in my HTML. Each ng-include
is creating an isolated scope for itself which apparently is causing a lot of trouble for me.
For example.
<div ng-controller="parent">
<div ng-include src="'id1'">
</div>
<div ng-include src="'id2'">
</div>
<div ng-include src="'id2'">
</div>
</div>
In the html mentioned above, 4 scopes are getting created. 1 at parent where controller
is defined and 3 are getting created by default at each ng-include src
.
Is it at all possible to prevent ng-include
from creating an isolated scope for itself? If It is not possible then is there a workaround for it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…