what is the purpose of ng-repeat in embedded widgets using sp-widget

Ansuha Chipuri
Kilo Guru

What is the purpose of using ng-repeat once we get the response of using spUtil.get?

 

HTML:

<div id="tabcontainer" ng-repeat="i in data.widgets">

      <sp-widget widget="i.currentWidget"></sp-widget>

</div>

 

 

2 REPLIES 2

Samaksh Wani
Giga Sage
Giga Sage

Hello @Ansuha Chipuri 

 

The ng-repeat directive repeats a set of HTML, a given number of times.

The set of HTML will be repeated once per item in a collection.

The collection must be an array or an object.

 

If you have an collection of objects, the ng-repeat directive is perfect for making a HTML table, displaying one table row for each object, and one table data for each object property. See example below.

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.

 

Regards,

Samaksh

Peter Bodelier
Giga Sage

Hi @Ansuha Chipuri,

 

It makes it easier to display several data items, without the need to define every single one of them. It makes the display of your data dynamic.

 

Angular ng-repeat Directive (w3schools.com)


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.