本文整理汇总了TypeScript中angular.element.each方法的典型用法代码示例。如果您正苦于以下问题:TypeScript element.each方法的具体用法?TypeScript element.each怎么用?TypeScript element.each使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular.element
的用法示例。
在下文中一共展示了element.each方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
$scope.$watchCollection('$izendaInstantReportStorageService.getAllFieldsInActiveTables(true)', function (newActiveFields) {
// add:
var countOfChanges = 0;
angular.element.each(newActiveFields, function () {
var newActiveField = this;
var found = false;
angular.element.each(vm.activeFields, function () {
if (this.sysname === newActiveField.sysname)
found = true;
});
if (!found) {
vm.activeFields.push(newActiveField);
countOfChanges++;
}
});
// remove:
var i = 0;
while (i < vm.activeFields.length) {
var field = vm.activeFields[i];
var found = false;
for (var j = 0; j < newActiveFields.length; j++) {
if (newActiveFields[j].sysname === field.sysname)
found = true;
}
if (!found) {
vm.activeFields.splice(i, 1);
countOfChanges++;
} else
i++;
}
$izendaInstantReportPivotService.syncPivotState(vm.activeFields);
});
示例2: function
$scope.$watchCollection('$izendaInstantReportStorageService.getAllFieldsInActiveTables(true)', function (newActiveFields) {
// sync collection elements:
// add:
angular.element.each(newActiveFields, function () {
var newActiveField = this;
if (!newActiveField.allowedInFilters)
return;
var found = false;
angular.element.each(vm.activeFields, function () {
if (this === newActiveField)
found = true;
});
if (!found)
vm.activeFields.push(newActiveField);
});
// remove:
var i = 0;
while (i < vm.activeFields.length) {
var field = vm.activeFields[i];
var found = false;
for (var j = 0; j < newActiveFields.length; j++) {
if (newActiveFields[j] === field)
found = true;
}
if (!found)
vm.activeFields.splice(i, 1);
else
i++;
}
});
示例3: 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;
});
示例4: function
$izendaInstantReportStorageService.searchInDataDources(vm.searchString, vm.searchResults.length, vm.searchResults.length + count - 1).then(function (searchResults) {
previousResultsCount = searchResults.length;
angular.element.each(searchResults, function () {
vm.searchResults.push(this);
});
vm.searchPanelOpened = true;
$scope.$applyAsync();
vm.searchQueryRunning = false;
});
示例5: function
vm.prepareConfig = function () {
if (!angular.isObject(vm.visualizationConfig))
return;
if (!angular.isArray(vm.visualizationConfig.categories))
return;
angular.element.each(vm.visualizationConfig.categories, function (iCategory: number, category: any) {
category.opened = iCategory === 0;
});
};