angular.js - How does the ngRepeat directive in angular split the scope and copy the template?
伊谢尔伦
伊谢尔伦 2017-05-15 16:52:12
0
1
547

Just two questions

1. ngRepeat will clone the template and then display each element in the array separately. So how does it do it? Is it to assign the scrope of each template instance to an array element?

2. How do I clone these templates and then dynamically bind the data binding, instructions and other things of the templates to them?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
我想大声告诉你

The repeat instruction watches the array (or object), and then loops through each item:
Use $transclude to get new content (already bound), and transclude will create a new scope, which is the scope used in repeat.

You can find it in the source code of repeat https://github.com/angular/angular.js/blob/master/src/ng/directive/ngR...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template