how to write a 'double' and a 'ntimes' directive for angularjs?

前端 未结 2 1153
有刺的猬
有刺的猬 2021-01-31 00:22

I am having trouble understand the \'ngRepeat\' directive so I wish to learn how angularjs works by writing a \'double\' directive and then extending with an \'ntimes\' directiv

2条回答
  •  遥遥无期
    2021-01-31 01:01

    The ng-repeat directive is mainly used to iterate over items on lists/arrays/collections (i.e. ng-repeat="item in list") and does much more than simply cloning elements. Please take a look at angularjs ng-repeat directive documentation.

    If you really just want to clone elements, try something like this: http://jsfiddle.net/hp9d7/

提交回复
热议问题