本文整理汇总了TypeScript中angular.isObject函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isObject函数的具体用法?TypeScript isObject怎么用?TypeScript isObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isObject函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: if
constraintFilters.forEach(constraintFilter => {
const constraintFilterOperatorValue = constraintFilter && constraintFilter.operator ? constraintFilter.operator.value : '';
if (constraintFilter.field !== null && angular.isObject(constraintFilter.operator)
&& constraintFilterOperatorValue !== '' && angular.isArray(constraintFilter.values)
&& constraintFilter.values.length > 0) {
const constraintParamPart = {};
constraintParamPart[`fc${counter}`] = constraintFilter.field.sysname;
constraintParamPart[`fo${counter}`] = constraintFilterOperatorValue;
const constraintOperatorType = this.getFieldFilterOperatorValueType(constraintFilter.operator);
if (constraintOperatorType === 'twoValues') {
constraintParamPart[`fvl${counter}`] = constraintFilter.values[0];
constraintParamPart[`fvr${counter}`] = constraintFilter.values[1];
} else if (constraintOperatorType === 'twoDates') {
constraintParamPart[`fvl${counter}`] = moment(constraintFilter.values[0]).format(this.$izendaSettingsService.getDateFormat().shortDate);
constraintParamPart[`fvr${counter}`] = moment(constraintFilter.values[1]).format(this.$izendaSettingsService.getDateFormat().shortDate);
} else if (constraintOperatorType === 'oneDate') {
constraintParamPart[`fvl${counter}`] = moment(constraintFilter.values[0]).format(this.$izendaSettingsService.getDateFormat().shortDate);
} else if (constraintOperatorType === 'field') {
const val = angular.isObject(constraintFilter.values[0])
? constraintFilter.values[0].sysname
: '';
constraintParamPart[`fvl${counter}`] = val;
} else {
constraintParamPart[`fvl${counter}`] = constraintFilter.values.join(',');
}
angular.extend(queryParams, constraintParamPart);
counter++;
}
});
示例2: function
vm.isSubtotalExpressionDisabled = function () {
if (!angular.isObject(vm.field))
return true;
if (!vm.isSubtotalsEnabled)
return true;
if (!angular.isObject(vm.field.groupBySubtotalFunction))
return true;
return vm.field.groupBySubtotalFunction.value !== 'EXPRESSION';
};
示例3: function
var load = function (file) {
if (!file || (!angular.isString(file.prefix) || !angular.isString(file.suffix))) {
throw new Error('Couldn\'t load static file, no prefix or suffix specified!');
}
var fileUrl = [
file.prefix,
options.key,
file.suffix
].join('');
if (angular.isObject(options.fileMap) && options.fileMap[fileUrl]) {
fileUrl = options.fileMap[fileUrl];
}
return $http(angular.extend({
url: fileUrl,
method: 'GET',
headers: {'Cache-Control': 'no-cache', 'Pragma': 'no-cache'},
silentCall: true
}, options.$http))
.then(function(result) {
return result.data;
}, function () {
return $q.reject(options.key);
});
};
示例4: customizer
export function assignPartialDeep<T extends TPartial, TPartial>(
destination: T,
partial: TPartial,
optionalPropSelector: (key: string, destination: T) => boolean = () => false,
customizer: (destValue: any, srcValue: any, key: string) => any = () => undefined
) {
const keys = Object.keys(partial);
for(const key of keys) {
let srcVal = partial[key];
if (srcVal === undefined) {
if (optionalPropSelector(key, destination)){
destination[key] = srcVal;
} else {
// don't assign undefined to destination
}
continue;
}
const destVal = destination[key];
const customVal = customizer(destVal, srcVal, key);
if (customVal !== undefined){
destination[key] = customVal;
} else if (ng1.isArray(srcVal)) {
destination[key] = [...srcVal];
} else if (!ng1.isObject(srcVal)) {
destination[key] = srcVal;
} else {
destination[key] = assignPartialDeep(destVal, srcVal);
}
}
return destination;
}
示例5: function
vm.onPivotColumnFieldSelect = function () {
if (vm.pivotColumn !== null) {
var sourceField = $izendaInstantReportStorageService.getFieldBySysName(vm.pivotColumn.sysname);
var groupName = null;
var oldPivotColumn = $izendaInstantReportPivotService.getPivotColumn();
if (angular.isObject(oldPivotColumn) && sourceField.sysname === oldPivotColumn.sysname) {
groupName = oldPivotColumn.groupByFunction.value;
}
$izendaInstantReportStorageService.copyFieldObject(sourceField, vm.pivotColumn, true);
$izendaInstantReportStorageService.resetFieldObject(vm.pivotColumn);
vm.pivotColumn.isPivotColumn = true;
$izendaInstantReportPivotService.setPivotColumn(vm.pivotColumn);
$izendaInstantReportStorageService.initializeField(vm.pivotColumn).then(function () {
if (groupName !== null) {
angular.element.each(vm.pivotColumn.groupByFunctionOptions, function () {
if (this.value === groupName)
vm.pivotColumn.groupByFunction = this;
});
}
if (vm.cellValues.length === 0) {
vm.addCellValue();
}
vm.updateReportSetValidationAndRefresh();
$scope.$applyAsync();
});
}
};
示例6:
const removePrototype = (srcVal: any, objVal: any) => {
if (ng1.isObject(objVal) && !ng1.isArray(objVal)) {
return _.toPlainObject(objVal);
} else {
return objVal;
}
};
示例7: function
var extractValueToCompare = function (item: any) {
if (angular.isObject(item) && angular.isString(filterOn)) {
return item[filterOn];
} else {
return item;
}
};
示例8:
this.$izendaDashboardQueryService.loadDashboardNew(reportFullName, !!updateFromSource).then(dashboardModel => {
if (!angular.isObject(dashboardModel))
throw `Failed to load dashboard '${reportFullName}'`;
// set current rights
this.$izendaCompatibilityService.setRights(dashboardModel.effectiveRights);
this.$izendaCompatibilityService.setUsesHiddenColumns(dashboardModel.usesHiddenColumns);
// update names
dashboardModel.reportFullName = this.$izendaSettingsService.getReportFullName(dashboardModel.reportName, dashboardModel.reportCategory);
dashboardModel.tiles.forEach(tile => {
tile.reportName = this.$izendaUrlService.extractReportName(tile.reportSetName);
tile.reportCategory = this.$izendaUrlService.extractReportCategory(tile.reportSetName);
});
// set legacy filters from response
this._setFiltersData(dashboardModel.filters);
// notify that model was changed and report was loaded
this.model.onNext(dashboardModel, this);
// show hidden columns warning
if (this.$izendaCompatibilityService.isUsesHiddenColumns()) {
this.$izendaUtilUiService.showMessageDialog(
this.$izendaLocaleService.localeText(
'js_dashboardUsesHiddenColumns',
'Dashboard contains tile with report which contains unavailable fields. Please re-save original report or chose another one.'));
}
this.isLoaded.onNext(true, this);
}, error => {
示例9:
var urlMatcher = _.find(urlMatchers,function(matcher: any){
var params = matcher.exec(url);
if(angular.isObject(params)){
data.params=params;
return true;
}
return false;
});