【发布时间】:2017-01-24 04:17:19
【问题描述】:
当ng-if="expression value is 0" 无法正常工作时,我遇到了问题。
这里是 plunker 的链接:http://plnkr.co/edit/dILXSIHHzvuv1nhbxdga?p=info
在选择更改时,我使用模型值来显示特定的文本框。
<select ng-model="location.locationSchedule.scheduleType"
ng-options="schedule.id as schedule.name for schedule in scheduleTypes track by schedule.id">
<option value="">Choose a Schedule Type</option>
</select>
还有输入字段
<input ng-model="location.locationSchedule.frequency"
placeholder="Enter Week No."
ng-if="location.locationSchedule.scheduleType == 0"/>
<input ng-model="location.locationSchedule.frequency"
placeholder="Enter Week No."
ng-if="location.locationSchedule.scheduleType == 1"/>
如果location.locationSchedule.scheduleType == 1 它显示特定的文本框,但当它为0 时不显示
【问题讨论】:
标签: javascript angularjs angular-ng-if