zoukankan      html  css  js  c++  java
  • angular笔记_5(全选/反选)

    全选和反选

    BUG:当鼠标点击其中一个选项后,在点击全选按钮,该选项失效 

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
    </head>
    <body>
    <div ng-app="hd" ng-controller="ctrl">

    <input type="text" ng-model="user.email" ng-readonly="user.uid"/>
    <hr/>
    <table>
    <tr>
    <td>
    <input type="checkbox" ng-model="all" >
    <span ng-bind="!all?'全选':'取消'"></span>
    </td>
    <td>名称</td>
    <td>网址</td>
    </tr>
    <tr ng-repeat="v in data">
    <td><input type="checkbox" ng-model="all"></td>
    <td>{{v.name}}</td>
    <td>{{v.url}}</td>
    </tr>
    </table>
    </div>
    <script>
    var m=angular.module('hd',[]);
    m.controller('ctrl',['$scope',function($scope){
    $scope.user={name:'百度',uid:1,email:'11111@qq.com'};

    $scope.data=[{name:'百度',url:'baidu.com'},
    {name:'新浪',url:'sina.com'},
    {name:'搜狐',url:'souhu.com'},
    {name:'博客',url:'blog.com'}
    ];
    }]);
    </script>
    </body>
    </html>

  • 相关阅读:
    shutil模块详解
    pycharm连接服务器
    python中__name__属性的使用
    ORM学习笔记
    ORM连表操作
    python操作mysql实例
    python登录项目
    pycharm建立第一个django工程-----windows中
    打印顺序
    shell脚本
  • 原文地址:https://www.cnblogs.com/yewook/p/8075183.html
Copyright © 2011-2022 走看看