如何将删除方法更改为在NG-ADMIN中发布方法



我想将 deleteMethod更改为ng-admin中的post方法。

用于将createMethod从帖子更改为我使用的方法:

user.createMethod('put');

我想删除发布方法。

user.deleteMethod('post');

以上不起作用。请帮助我。

如果要删除选定的项目,则可以使用批处理,然后创建一个带有所需名称的目录并点击邮政请求。

.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>&nbsp;Confirm</span>`
    };

最新更新