0
我想我的程序過濾器,但我不知道如何做到這一點..谷歌只給我那些搜索字段過濾器或複選框的名稱..我沒有得到它..迄今..角度過濾器的複選框,與複選框
var app = angular.module('surveyApp', []);
app.controller('BackendCtrl', function($scope, $http){
$scope.informations = [
{
id: 123,
text: "first object",
checkbox: 1,
},
{
id: 222,
text: "second object",
checkbox: 1,
},
{
id: 303,
text: "third object",
checkbox: 1,
},
{
id: 412,
text: "fourth object",
checkbox: 0,
},
{
id: 500,
text: "fifth object",
checkbox: 0,
},
{
id: 666,
text: "sixth object",
checkbox: 1,
},
];
});
這是我的角度數據!
<html>
<head>
<title>Survey</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
</head>
<body ng-app="surveyApp" ng-controller="BackendCtrl">
<div style="width: 150px; height: 40px; border:1px solid;">
<input type="checkbox"/> All objects
</div>
<div>
<table border="1" style="margin: 0 auto;" ng-controller="BackendCtrl">
<tr ng-repeat="item in informations">
<td>{{item.id}}</td>
<td>{{item.text}}</td>
<td><input type="checkbox" ng-model="item.checkbox" ng-true-value="1" ng-false-value="0"/>cool</td>
</tr>
</table>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script>
<script src="app.js"></script>
</body>
</html>
第一個複選框應該是我的item.checkbox ..如果它的真實,所有數字應該給,如果它的虛假只有「不酷」的對象過濾器.. greez 請幫助我
那麼......哪裏出了問題?任何錯誤可能? –
有沒有錯誤..我需要在那裏的過濾器,theres沒有 –