本文整理汇总了TypeScript中angular.isString函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isString函数的具体用法?TypeScript isString怎么用?TypeScript isString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isString函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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);
});
};
示例2: _saveReportWithGivenName
/**
* Save report with selected name
*/
function _saveReportWithGivenName(reportName, reportCategory) {
var category = reportCategory;
if (!angular.isString(category) || category.toLowerCase() === UNCATEGORIZED.toLowerCase())
category = '';
var rsReportName = reportName;
if (angular.isString(reportCategory) && reportCategory !== '')
rsReportName = reportCategory + $izendaSettingsService.getCategoryCharacter() + rsReportName;
var savePromise;
if (angular.isString(reportName) && reportName !== '') {
savePromise = $izendaInstantReportStorageService.saveReportSet(reportName, category);
} else {
savePromise = $izendaInstantReportStorageService.saveReportSet();
}
savePromise.then(function () {
var notificationMessage = $izendaLocaleService.localeTextWithParams('js_ReportSaved', 'Report "{0}" sucessfully saved.', [rsReportName]);
$izendaUtilUiService.showNotification(notificationMessage);
}, function (error) {
var errorTitle = $izendaLocaleService.localeText('js_FailedSaveReportTitle', 'Report save error');
var errorMessage = $izendaLocaleService.localeTextWithParams(
'js_FailedSaveReport',
'Failed to save report "{0}". Error description: {1}',
[rsReportName, error]);
$izendaUtilUiService.showErrorDialog(errorMessage, errorTitle);
});
}
示例3: eventLogger
function eventLogger(event, to, toParams, from, fromParams) {
if (logEvents && angular.isFunction(to.to)) {
const transition = to;
log += event.name + '(' + transition.to().name + ',' + transition.from().name + ');';
} else if (logEvents) {
log +=
event.name +
'(' +
(angular.isString(to.name) ? to.name : to) +
',' +
(angular.isString(from.name) ? from.name : from) +
');';
}
}
示例4: function
var extractValueToCompare = function (item: any) {
if (angular.isObject(item) && angular.isString(filterOn)) {
return item[filterOn];
} else {
return item;
}
};
示例5: function
vm.runSearchQuery = function (clearResults) {
if (vm.searchQueryRunning)
return;
if (!angular.isString(vm.searchString) || vm.searchString.trim() === '') {
vm.searchPanelOpened = false;
vm.searchQueryRunning = false;
return;
}
vm.searchQueryRunning = true;
var count = 50;
if (clearResults) {
vm.searchResults = [];
previousResultsCount = null;
angular.element('#izInstDataSourcesTree').get(0).scrollTop = 0;
}
if (previousResultsCount === 0) {
vm.searchQueryRunning = false;
return;
}
$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;
});
};
示例6:
model: ($transition$: any, DomainTypesService: any)=> {
if (angular.isString($transition$.params().domainTypeId)) {
return DomainTypesService.findById($transition$.params().domainTypeId);
} else {
return DomainTypesService.newDomainType();
}
},
示例7: ExtendReportExport
return this.$q((resolve, reject) => {
try {
var printUrl = `${this.$izendaUrlService.settings.urlRsPage}?p=htmlreport&print=1`;
// print single tile if parameter is set:
if (angular.isString(reportForPrint) && reportForPrint !== '')
printUrl += `&reportPartName=${encodeURIComponent(reportForPrint)}`;
// izpid and anpid will be added inside the ExtendReportExport method
this.$timeout(() => {
let newWindow = ExtendReportExport(responseServer.OpenUrl, printUrl, 'aspnetForm', '', '', true);
if ('WebkitAppearance' in document.documentElement.style) {
let intervalId = this.$interval(() => {
if (!newWindow || newWindow.closed) {
this.$interval.cancel(intervalId);
intervalId = null;
resolve();
}
}, 500);
} else {
resolve();
}
}, 500);
} catch (e) {
console.error(e);
reject(e);
}
});
示例8: response
function response (response) {
var alertKey = response.headers('X-angular2UaaGatewayApp-alert');
if (angular.isString(alertKey)) {
//AlertService.success(alertKey, { param : response.headers('X-angular2UaaGatewayApp-params')});
}
return response;
}
示例9: 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;
};