<! DOCTYPE html>
<meta charset= "UTF-8" >
<title> Third JoJo </title>
<script type= "Text/javascript" src= "Angular.js" ></script>
<script src= "Jquery-3.2.1.js" ></script>
<script>
var app=angular.module ("MyApp", []);
App.controller ("Mycontroller", function ($scope) {
$scope. user=[
{checked:false,id: "1324", Name: "ipad", Price: "3400.00", Num: "Ten", Item: "0"},
{checked:false,id: "4567", Name: "Aphone", Price: "6400.00", num: "+", Item: "1"},
{checked:false,id: "3546", Name: "Mypad", Price: "4400.00", Num: "$", Item: "2"},
{checked:false,id: "1987", Name: "Zpad", Price: "8400.00", num: "+", Item: "3"}
]
$scope. Nc=function (index) {
if ($scope. User[index].checked==false) {
Alert ("Please select Delete after");
}else{
if (Confirm ("confirm Delete")) {
$scope. User.splice (index,1)
}
}
}
$scope. Qs=function () {
for (Var i=0;i< $scope. user.length;i++) {
if ($scope. User[i].checked==false) {
Alert ("Please select Delete after");
}else{
if (Confirm ("Confirm all Delete")) {
$scope. user=[];
}
}
}
}
$scope. Selectallclick=function (SA) {
for (Var i=0;i< $scope. user.length;i++) {
$scope. User[i].checked=sa;
}
}
$scope. Echochange=function (ck,id) {
if (Ck==false) {
$scope. User[id].checked=true;
}else{
$scope. User[id].checked=false;
}
}
$scope. Togg=function (Tit) {
$scope. Title=tit;
$scope. desc =! $scope. desc;
}
})
</script>
<style>
. d{
width:100%;
height:50px;
Background:gainsboro;
}
td{
Background:white;
}
</style>
<body ng-app= "myApp" ng-controller= "Mycontroller" >
<div class= "D" >
<input type= "text" style= "float:left;line-height:30px" ng-model= "Serch" >
<button style= "float:right;line-height:30px" ng-click= "QS ()" > Bulk Delete </button>
</div>
<table style= "width:100%; height:400px; background:gainsboro;margin-top:40px "cellspacing=" 1px ">
<tr>
<td><input type= "checkbox" ng-model= "SelectAll" ng-click= "Selectallclick (selectall)" ></td>
<TD ng-click= "Togg (' id ')" > Product Code </td>
<TD ng-click= "Togg (' name ')" > Product name </td>
<TD ng-click= "Togg (' Price ')" > Commodity prices </td>
<TD ng-click= "togg (' num ')" > Commodity inventory </td>
<td> Data Operations </td>
</tr>
<tr ng-repeat= "u in User|filter:serch|orderby:title:desc" >
<td><input type= "checkbox" ng-checked= "u.checked" ng-click= "Echochange (u.checked, $index)" ></td>
<td>{{u.id}}</td>
<td>{{u.name}}</td>
<td>¥:{{u.price}}</td>
<td>{{u.num}}</td>
<td><button ng-click= "NC ($index)" > Delete </button></td>
</tr>
</table>
</body>
HTML Angular Shopping Cart