1

似乎有一个不好的编码习惯,但它并没有准确地说明在哪里。有人有这方面的经验吗?

这是导致错误的代码


$scope.removeAllSelectedItems = function (selectedItems) {

            if (selectedItems.length > 0) {
                    var index = $scope.carriersWithTrucks.findIndex(d => d.carrierId == selectedItems[0].carrierId);
                    $scope.carrierTrucks = $scope.carriersWithTrucks[index].trucks;
                    var findOption = $scope.carriersWithTrucks.find(d => d.carrierId === selectedItems[0].carrierId);
                    $scope.selectedCarrierWithTrucks = findOption;
                }
            };  
(function anonymous($filter,ensureSafeMemberName,ensureSafeObject,ensureSafeFunction,getStringValue,ensureSafeAssignContext,ifDefined,plus,text
) {
"use strict";
var fn=function(s,l,a,i){var v0,v1,v2,v3=l&&('removeAllSelectedItems' in l),v4,v5=l&&('mobileUserTrucks' in l);v2=v3?l:s;if(!(v3)){if(s){v1=s.removeAllSelectedItems;}}else{v1=l.removeAllSelectedItems;}ensureSafeObject(v1,text);if(v1!=null){ensureSafeFunction(v1,text);if(!(v5)){if(s){v4=s.mobileUserTrucks;}}else{v4=l.mobileUserTrucks;}ensureSafeObject(v4,text);v0=ensureSafeObject(v2.removeAllSelectedItems(ensureSafeObject(v4,text)),text);}else{v0=undefined;}return v0;};return fn;

4

0 回答 0