angularjs - Why does the ng-repeat directive create a child scope? -
Question: Why ng-repeat instructions make a hair scope? I do not understand why this is the matter. Creating a new radius makes sense to an extent if you make a hair control clearly, but why would it automatically make one for every ng-repetition? I think this confuses me because if you loop in JS, this does not mean that the code outside the loop can not enter any variable inside. Example: DOM Javascript is not in the items in your archive Previously, this markup: On the left side, the radius will spread on some more radius like: (for example some estimated) For
(var x = 0; x and lt; 10; x ++) {var y = x} alert (y); ng-repeat It is necessary to have separate scope on the ING, which is tied to repeat DOM elements and they make a tree of scraps that some mirror structure (somewhat) of the page
& lt; Body ng-app = "myapp" & gt; & Lt; Div ng-repeat = "item in item" & gt; & Lt; P & gt; {{Item.name}} & lt; / P & gt; & Lt; / Div & gt; & Lt; / Body & gt;
The root area of the body is the scope of the div div
Comments
Post a Comment