有没有办法将Spring返回的Spring的modelAttribute绑定到AngularJS模型?

时间:2014-10-31 10:42:57

标签: javascript angularjs spring jsp jstl

我有Spring JSP返回元素的Map。第一种方法是使用JSTL用选项填充select html元素。像这样:

<select name="environment" id="environment" name="environment_name" class="form-control" ng-model="environment" required>
                <c:forEach var="environment" items="${environmentsMap}">
                    <c:if test="${environment!=null}">
                        <option value="${environment.key}"
                                <c:if test="${environment=='TEST'}"> selected="selected"</c:if>
                                >${environment.key}</option>
                    </c:if>
                </c:forEach>
            </select>

前端使用AngularJS。有没有办法将返回的Spring的模型属性绑定到Angular模型,这样我就可以使用Angular&#39; s ng-repeat来填充select?

0 个答案:

没有答案