If I understand correctly, you want to avoid the extra AJAX call/roundtrip,
right?
Two main options here:
- no need to edit the data: render the list yourself in pure html, no need
for ng-repeat. You can still add Angular components/binding or whatever
tags, but you don't need ng-repeat specifically.
- you need to manipulate the data on client side: use ng-init.
Example of first list (rendered with whatever you're doing in the JSP)
bellow. Let's assume you provide a "colorList" list dynamically.
<select ng-model="model.color">
<c:forEach items="${colorList}" var="color">
<option value="${color}">
${color}
</option>
</c:forEach>
</select>
Now your angular client app can get the value out of your server-prepped
list.
The second version, where you wanna manipulate the said list, you can try
with ng-init angular directive:
<select ng-model="model.color" ng-init="colors = ${colorListStringified}">
<option ng-repeat="color in colors" value="color">{{ color }} </option>
</select>
Now your angular app can get access to the list itself and, e.g. add more
colors to the list.
--
You received this message because you are subscribed to the Google Groups
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.