本文整理汇总了TypeScript中angular.isNumber函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isNumber函数的具体用法?TypeScript isNumber怎么用?TypeScript isNumber使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isNumber函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: findInDatasources
/**
* Search fields in datasources (returns range of values [from, to])
*/
findInDatasources(searchString, from, to) {
let params = [encodeURIComponent(searchString)];
if (angular.isNumber(from) && angular.isNumber(to))
params = params.concat(String(from), String(to));
return this.$izendaRsQueryService.query('findfields', params, {
dataType: 'json'
}, {
handler: sString => `Failed to search fields and tables by keyword: ${sString}`,
params: [searchString]
});
}
示例2: setTimeoutTime
setTimeoutTime(seconds: number): void {
if (angular.isNumber(seconds) && seconds >= 0) {
this.options.timeout = seconds;
} else {
throw new Error("Timeout time must be a positive integer in seconds or 0 to disable it.");
}
}
示例3: PuiIdleValidate
export function PuiIdleValidate($interval: angular.IIntervalService): angular.IDirective {
return {
restrict: 'A',
scope: {
idleValidate: '&',
idleValidateKeypress: '&',
idleValidateMsec: '<'
},
link($scope: IdleValidateScope, $element) {
let intervalTimer: angular.IPromise<any>;
let milliseconds = $scope.idleValidateMsec;
if (!angular.isNumber($scope.idleValidateMsec)) {
milliseconds = 1000;
}
$element.bind('keyup', () => {
if (angular.isFunction($scope.idleValidateKeypress)) {
$scope.$apply($scope.idleValidateKeypress);
}
if (angular.isDefined(intervalTimer)) {
$interval.cancel(intervalTimer);
}
intervalTimer = $interval(() => $scope.idleValidate(), milliseconds, 1);
});
}
};
}
示例4: return
return (target: any, key?: string, index?: number): void => {
if (angular.isNumber(index)) {
target.$inject = target.$inject || [];
target.$inject[index] = args[0];
} else {
target.$inject = args;
}
};
示例5: return
return (target: any, key?: string, index?: number): void => {
if (angular.isNumber(index)) {
target.$inject = target.$inject || [];
target.$inject[index] = typeof args[0] === 'function' ? (args[0] as any).name : args[0];
} else {
target.$inject = args;
}
};
示例6: function
vm.removeColumn = function (field) {
if (!angular.isNumber(field.parentFieldId)) {
// if it is not multiple column for one database field.
$izendaInstantReportStorageService.applyFieldChecked(field).then(function () {
var selectedField = $izendaInstantReportStorageService.getCurrentActiveField();
if (selectedField === field)
$izendaInstantReportStorageService.applyFieldSelected(field, false);
vm.updateReportSetValidationAndRefresh();
$scope.$applyAsync();
});
} else {
var parentField = $izendaInstantReportStorageService.getFieldById(field.parentFieldId);
$izendaInstantReportStorageService.removeAnotherField(parentField, field);
vm.updateReportSetValidationAndRefresh();
$scope.$applyAsync();
}
};
示例7: refreshDashboard
/**
* Refresh all dashboard tiles (without reloading)
* @param {number} intervalIndex auto refresh interval index. Automatic refresh will turn on if this argument is set.
*/
refreshDashboard(intervalIndex) {
this.$izendaDashboardStorageService.refreshDashboard(false, false);
if (!this.autoRefresh)
return;
if (angular.isNumber(intervalIndex)) {
this.cancelRefreshInterval();
const selectedInterval = this.autoRefresh.intervals[intervalIndex];
selectedInterval.selected = true;
let intervalValue = selectedInterval.value;
if (intervalValue >= 1) {
intervalValue *= 1000;
this.refreshInterval = setInterval(
() => this.$izendaDashboardStorageService.refreshDashboard(false, false),
intervalValue);
}
}
}