zoukankan      html  css  js  c++  java
  • Angularjs 数据双向绑定

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible"content="edge" />
    <meta name="viewport"content="width=device-width,initial-scale=1" />
    <title></title>
    <meta charset="utf-8" />
    <link rel="stylesheet"href="bootstrap/css/bootstrap.min.css" />
    <style>

    </style>
    </head>
    <body>
    <div class="container"style="padding:50px">
    <div data-ng-app="myApp"data-ng-controller="myCtrl">
    <p>姓名:<input type="text"data-ng-model="name" /></p>
    <p>性别:<input type="radio"data-ng-model="sex" value="男" name="sex"/>男<input type="radio"data-ng-model="sex" value="女" name="sex"/>女</p>
    <p>兴趣:<input type="checkbox"value="跑步" data-ng-model="interest1"/>跑步<input type="checkbox"value="羽毛球" data-ng-model="interest2"/>羽毛球<input type="checkbox"value="编程" data-ng-model="interest3"/>编程</p>
    <br /><hr />
    <fieldset>
    <legend>{{name}}:个人信息如下:</legend>
    <p>性别:{{sex}}</p>
    <p>兴趣:{{interest1}}{{interest2}}{{interest3}}</p>
    </fieldset>

    </div>


    </div>

    <script src="jQuery/jquery-2.2.0.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
    <script>
    angular.module("myApp", []).controller("myCtrl", function ($scope) {

    })
    </script>
    </body>
    </html>

  • 相关阅读:
    bzoj4734
    51nod1056
    51nod1048
    51nod1248
    51nod1044
    51nod1132
    51nod1146
    51nod1226
    Spring Boot: Jdbc javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
    sqlserver命令创建数据库和表 demo
  • 原文地址:https://www.cnblogs.com/melao2006/p/5116908.html
Copyright © 2011-2022 走看看