【发布时间】:2016-07-12 19:02:07
【问题描述】:
我有一个表单可以像这样更新提交时的值
<form ng-submit="updateMovie()">
<input type="text" ng-model="movie.title"/>
<input type="text" ng-model="movie.rating"/>
//what to attach here at ng-model//
<input type="text" ng-modal ="movie.__"/>
there could be many genre inputs based on how many user wants to input
</form>
表单提交的对象将是以下类型。目前让我们忽略 ID。我不知道如何创建流派 即对象数组
"id": 4792,
"title": "Insidious",
"rating": "7.0",
"genres": [
{
"id": 3,
"name": "horror"
},
{
"id": 7,
"name": "Drama"
}
]
【问题讨论】:
-
您希望用户输入任何类型的类型还是您有他可以选择的类型?
-
查看各种可用的多选模块...类似于
tags在此处处理这些帖子的方式 -
@developer033 ,用户必须输入它们
标签: javascript angularjs api rest angular-ngmodel