zoukankan      html  css  js  c++  java
  • ng-model绑定表单,所示表单值的类型

    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值

              <input type="radio"  ng-model="myradio" value="radio1">  A 

        <input type="radio"  ng-model="myradio" value="radio2">  B

        <input type="radio"  ng-model="myradio" value="radio3">  C

        <h1>{{myradio}}</h1> ----(显示radio1/radio2/radio3)

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

      ng-model为选中的select的option的value值

        <select ng-model="myselect">

                <option   value="radio1">  A </option>

          <option   value="radio2">  B</option>

          <option   value="radio3">  C</option>

        </select>

        <h1>{{myselect}}</h1> ----(显示radio1/radio2/radio3)

     3.其余两种类类型

    • button 元素--------走ng-click调用函数
    • textarea 元素------和input的text类型一样
  • 相关阅读:
    网站常见的反爬虫和应对方法
    网站反爬虫
    webmagic的设计机制及原理-如何开发一个Java爬虫
    腾讯社区搜索架构演进
    搜索引擎评估与互联网用户行为建设
    深层网络搜索核心技术研讨
    Solr与Cassandra二级缓存实践
    .NET的前世今生与将来
    技术人生的职场众生相
    爆栈之旅
  • 原文地址:https://www.cnblogs.com/yogic/p/8259124.html
Copyright © 2011-2022 走看看