我的数据库中有educations
和school_courses
表。对于上述表格,我有两个单独的下拉列表。在educations
中有一个名为has_course
的列,它有2个值,1或0,如果值为1,则它有路径,如果没有,则为0。我只想启用school_courses的下拉菜单,如果教育下拉列表中的选定值在has_course
列中的值为1。提前谢谢!
答案 0 :(得分:0)
使用ng-if或ng-show隐藏第二个下拉列表
<select ng-model="education" ng-options="option.name for option in data.educations track by option.id">
</select>
<select ng-if="education === 1" ng-model="course" ng-options="option.name for option in data.courses track by option.id">
</select>