本文整理汇总了TypeScript中angular.element.grep方法的典型用法代码示例。如果您正苦于以下问题:TypeScript element.grep方法的具体用法?TypeScript element.grep怎么用?TypeScript element.grep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular.element
的用法示例。
在下文中一共展示了element.grep方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
vm.addFieldToReport = function (fieldSysName) {
if (!angular.isString(fieldSysName))
return;
var field = $izendaInstantReportStorageService.getFieldBySysName(fieldSysName, true);
if (field.checked) {
var anotherField = $izendaInstantReportStorageService.addAnotherField(field, true);
$izendaInstantReportStorageService.applyFieldChecked(anotherField).then(function () {
vm.updateReportSetValidationAndRefresh();
$scope.$applyAsync();
});
} else {
$izendaInstantReportStorageService.unselectAllFields();
field.selected = true;
$izendaInstantReportStorageService.setCurrentActiveField(field);
$izendaInstantReportStorageService.applyFieldChecked(field).then(function () {
vm.updateReportSetValidationAndRefresh();
$scope.$applyAsync();
});
}
// move field from last postions to selected position if it is drag-n-drop:
if (field.checked && vm.currentInsertColumnOrder >= 0) {
var fieldsArray = $izendaInstantReportStorageService.getAllVisibleFields().slice();
fieldsArray = angular.element.grep(fieldsArray, function (f: any) {
return !f.isVgUsed;
});
fieldsArray.sort(function (a, b) {
return a.order - b.order;
});
var from = fieldsArray.length - 1;
var to = vm.currentInsertColumnOrder;
$izendaInstantReportStorageService.moveFieldToPosition(from, to, false, true);
}
vm.currentInsertColumnOrder = -1;
};
示例2: function
vm.removeDrilldownFieldsFromAvailable = function () {
vm.allActiveFields = angular.element.grep(vm.allActiveFields, function (f: any) {
var found = false;
angular.element.each(vm.drillDownFields, function () {
var ddField = this;
if (ddField.id === f.id)
found = true;
});
return !found;
});
};