Angular 4 - using objects for option values in a select list

后端 未结 6 1033
南旧
南旧 2020-12-23 20:25

I know that similar questions have been asked, but I\'ve found none with a good answer. I want to create a select list in an Angular form, where the value for each option is

6条回答
  •  温柔的废话
    2020-12-23 20:42

    You can use [ngValue] instead of [value] on the -Elements. It works for me.

    I've found that information here: https://www.reddit.com/r/Angular2/comments/65run4/select_option_using_value_vs_ngvalue/

提交回复
热议问题