AngularJS的挑选设置默认值
在使用有角的时候使用挑选标签时会遇到绑定数据指定默认显示值可这样实现
!DOCTYPE html html ng-app=' note app ' ng-controller=' note ctrl ' head meta http-equiv=' keyword ' content=' keyword 1,keyword2,keyword 3 ' meta http-equiv=' description ' content='这是我的页面meta http-equiv=' content-type ' content=' text/html;charset=UTF-8 '脚本类型=' text/JavaScript ' src=' http :/插件/角度。量滴js '/script/head body ng-app=' note app ' ng-controller=' note ctrl ' select ng-options=' act。id为act。类型列表' ng-model=' znotevo中动作的名称。type/select/body脚本类型=' text/JavaScript ' angular。模块(' note app ',[]).控制器(' noteCtrl ',函数($ scope){ $ scope。TypeList=[{ id : ' 01 ',名称: '任务},{ id : '02 ',名称: '日志},{ id : '03 ',名称: '会议},{ id : '04 ',名称: '学习},{ id : '05 ',名称: '总结},{ id : '99 ',名称: '其他' } ];$scope .ZNoteVo={ };$scope .znotevo . type=' 03 });/script /html当我们选择类型是03时则默认是会议
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持,如有疑问请留言或者到本站社区交流讨论,大家共同进步!