angularJS使用ng-repeat 生成tr如何通过复选框选定

代码如下:


<!DOCTYPE html>

<html ng-app="exampleApp">

<head>

    <meta charset="UTF-8">

    <title>Title</title>

    <script src="active/jquery.min.js"></script>

    <script src="active/angular.min.js"></script>

    <script>

        angular.module("exampleApp",[])

            .controller("default",function ($scope) {

                $scope.items = [

                    {name:"zhou",age:25},

                    {name:"li",age:40},

                    {name:"zhu",age:27}

                ];


            })

    </script>

</head>

<body ng-controller="default">

<table>

    <thead><tr><th>#</th><th>姓名</th><th>年龄</th></tr></thead>

    <tbody >

        <tr ng-repeat="item in items">

            <td><input type="checkbox" /></td>

            <td>{{item.name}}</td>

            <td>{{item.age}}</td>

        </tr>

    </tbody>

</table>

</body>

</html>

https://img4.mukewang.com/5c2c838c00014e3801360100.jpg

如何得到我已经选择的两行数据

慕尼黑的夜晚无繁华
浏览 599回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript