本文整理汇总了TypeScript中angular.element类的典型用法代码示例。如果您正苦于以下问题:TypeScript element类的具体用法?TypeScript element怎么用?TypeScript element使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了element类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
angular.element(document).ready(() => {
// common settings promise:
var commonQuerySettingsPromise = IzendaCommonLoader.loadSettings();
// instant report settings promise:
var urlSettings = window.urlSettings$;
var rsPageUrl = urlSettings.urlRsPage;
var settingsUrl = rsPageUrl + '?wscmd=getDashboardSettings';
var dashboardsSettingsPromise = angular.element.get(settingsUrl);
// wait while all settings are loaded:
angular.element
.when(commonQuerySettingsPromise, dashboardsSettingsPromise)
.then((commonSettingsResult, dashboardsSettingsResult) => {
// get instant report config object
var configObject = dashboardsSettingsResult[0];
// create and configure modules:
IzendaDashboardsLoader.configureModules(configObject);
// bootstrap application:
angular.bootstrap('#izendaDashboardMainContainer', ['izendaDashboard']);
});
});
示例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
$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);
});
示例4: loadSettings
static loadSettings() {
const deferredObject = angular.element.Deferred();
const urlSettings = window.urlSettings$;
const rsPageUrl = urlSettings.urlRsPage;
const settingsUrl = rsPageUrl + '?wscmd=getCommonSettings';
// load common settings:
angular.element.get(settingsUrl, (configJson) => {
var configObject = configJson as IIzendaCommonSettings;
angular
.module('izenda.common.core')
.constant('$izendaCommonSettings', configObject);
deferredObject.resolve();
});
return deferredObject.promise();
}
示例5: 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;
};
示例6: 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;
});
};
示例7: 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;
});