I've got a Mongoose schema which uses enumeration on one of its fields such as below.
var testSchema = new Schema({
name: {
type: String,
default: '0',
enum: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14'],
trim: true,
required: 'Title cannot be blank'
}
});
I would like to display the enums as options in a view with this code, but I'm unable to accomplish.
<datalist id="enums" data-ng-repeat="x in test.name.enumValues" >
<option data-ng-bind="x"></option>
</datalist>
Is there any possible way that I can do to display these enumerations in the view? Thanks in advance.