0

I am using the following in my HTML

<select class="form-control"
                        required
                        ng-model="crud.model.dateRange"                       
                        ng-options="range as range.description for range in crud.metaData.dateRanges"></select>

I added tt debug to see that I do have a proper crud.model.dateRange object. However, my form doesn't show the select properly initialized with my object info.

I have a vague recollection I had a similar problem before. Do you know how to make my form show the info properly?

4
  • stackoverflow.com/questions/43370479/… Check this link Commented May 23, 2018 at 4:42
  • I checked this and I was also reading several other answers with ng-options tag, but nothing as yet helpful. May be I need to try to set initial value for crud.model.dateRange in my controller's code to be from the array? (And not even return it originally); Commented May 23, 2018 at 4:49
  • can you share your data model? Commented May 23, 2018 at 4:50
  • I gave up (for now) and changed from object to just Id. This worked. E.g. I used range.id in ng-options. And changed my model to use Id instead of object too. Commented May 23, 2018 at 5:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.