Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 如何在angular js中获取选择选项文本非值_Angularjs - Fatal编程技术网

Angularjs 如何在angular js中获取选择选项文本非值

Angularjs 如何在angular js中获取选择选项文本非值,angularjs,Angularjs,这是我的密码 <div class="form-group"> <label class="control-label">Student Name: <span class="req-field">*</span> </label> <select ng-change="selectAction()" ng-model="formData.Name" ng-options="value.CompleStuId as v

这是我的密码

<div class="form-group">
  <label class="control-label">Student Name: <span class="req-field">*</span>
  </label>
  <select ng-change="selectAction()" ng-model="formData.Name" ng-options="value.CompleStuId as value.Name for value in myOptions" class="form-control" required>
    <option value="">-- Select --</option>
  </select>
</div>
请与我分享你的知识。提前感谢

如果您希望名称同时作为标签和所选值,则希望在myOptions中使用value.Name作为value.Name作为value

选择

对于阵列数据源:

select as label for value in array
其中:

value: local variable which will refer to each item in the array or each property value of object during iteration.
label: The result of this expression will be the label for <option> element. The expression will most likely refer to the value variable (e.g. value.propertyName).
select: The result of this expression will be bound to the model of the parent
学生姓名:* -挑选- {{formData.Name}
苏吉特,我们需要的远不止这些。也许是你在plunkr或JSFIDLE上尝试过的一个例子…你是在寻找文本而不是值还是选择值?-选择-Sibani SinghChetna BairagiShikha Sharma唯一的学生姓名我想得到JB所说的,您将在模型中获得所选选项的名称,即控制器作用域下的formData.name。朋友们,请查看此代码。我希望这对你们大家都足够了。你是普朗克,他没有填写你的选项。你能在里面放一些示例数据吗?NoMyValue= Value.Value作为值。MyopTosii中的值的名称要从数据库中选择GET课程名称和JounDATE值,然后单击“提交”按钮保存“选择学生姓名”。请考虑发布另一个问题来询问该问题。这似乎超出了原始问题的范围。另请参阅,以获取有关在本网站上提问的一些提示。