선택한 항목을 삭제하려면 batchActions로 이동 한 다음 원하는 이름의 디렉토리를 만들고 게시 요청을 누르십시오.
.batchActions([
'<batch-approvee type="confirm" selection="selection"></batch-approvee>' ])
지시어 코드 :
angular.module('myApp').directive('batchApprovee',['Restangular','$q','notification','$state',function(Restangular, $q, notification, $state){
return {
restrict: 'E',
scope: {
selection: '=',
type: '@'
},
link: function(scope, element, attrs) {
scope.icon = attrs.type == 'accept' ? 'glyphicon-thumbs-up' : 'glyphicon-thumbs-down';
scope.updateStatus = function() {
var cItems = {};
var data = [];
var allConfirmData = scope.selection;
allConfirmData.forEach(function(confirmItem,index){
cItems.id = confirmItem._identifierValue;
cItems.status = 2;
data.push(cItems);
cItems = {};
});
var config = {
headers : {
'Content-Type': 'application/json;'
}
}
notification.getBatchApproval(data,config).then(
function(res){
if(res&&res.data){
alert("Inventory Confirmed");
}
},
function(err){
alert(err);
})
}
},
template: ` <span ng-click="updateStatus()"><span class="glyphicon {{ icon }}" aria-hidden="true"></span> Confirm</span>`
};
나는 어디서나 문서에서'deleteMethod' 표시되지 않습니다. –
@Hopeful Llama : 예. 그냥 시도해 보지만 일하지는 않습니다. 다른 생각은 없나요? –