码迷,mamicode.com
首页 > 其他好文 > 详细

ng-model绑定表单,所示表单值的类型

时间:2018-01-10 16:55:57      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:显示   type   根据   text   class   ng-model   body   绑定   inpu   

Angularjs 表单类型:

  • input 元素
  • select 元素
  • button 元素
  • textarea 元素

1.input时根据类型不同,ng-model绑定的值不同

    1.1 text ----ng-mode为输入框的值

    <input type="text" ng-model="thisval"> 

    <p>{{thisval}}</p>

    1.2 checkbox----ng-model为选中状态true/false

    <input type="checkbox" ng-model="mytype">

    <div ng-show={{mytpye}}>是就显示,否就隐藏</div>

 1.3  radio----ng-model为选中的input的value值

           

 

ng-model绑定表单,所示表单值的类型

标签:显示   type   根据   text   class   ng-model   body   绑定   inpu   

原文地址:https://www.cnblogs.com/yogic/p/8259124.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!