I am trying to switch from a pure JavaScript implementation to using AngularJS. I am unable to figure how to use the model attribute with the form that is now using AngularJS.
Controller
@ModelAttribute("frequencies")
public Frequency[] frequencies() {
return Frequency.values();
}
@ModelAttribute("genders")
public Gender[] personGender() {
return Gender.values();
}
@RequestMapping(value="uform", method=RequestMethod.GET)
public String loadUFormPage(Model m) {
return "userManagment";
}
The initial JSP displayed all the Enum
s as:
<form:select path="gender" id="genderOptions">
<form:option value="">Select Gender</form:option>
<c:forEach items="${genders}" var="gender">
<form:option value="${gender}">${gender}</form:option>
</c:forEach>>
</form:select>
I am looking for an AngularJS equivalent of this JSP code since in AngularJS all data is passed as JSON.