我想点击按钮
关闭ng-repeat divHTML
<div ng-repeat="indexVal in vm.flowObject track by $index">
<div ng-show="listItems.title=='Menu'" class="Margin_Set" id="div2" scroll>
<button>
Close div
</button>
</div>
</div>
JS
$scope.listItems = [{
name: "some name",
title: "Menu"
}];
答案 0 :(得分:0)
您可以在点击时添加隐藏属性并将其设置为 true :
<div ng-repeat="indexVal in vm.flowObject track by $index">
<div ng-hide="indexVal.hidden == true" class="Margin_Set" id="div2" scroll>
<button ng-click="indexVal.hidden = true"> Close div </button>
</div>
</div>
答案 1 :(得分:0)
试试这样。
1 = 0.85
2 = 0.65
3 = 0.4
4 = 0.25
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope){
$scope.listItems = [{
name: "some name",
title: "Menu"
}];
});