本文整理汇总了TypeScript中caesium-core/lang.isBlank函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isBlank函数的具体用法?TypeScript isBlank怎么用?TypeScript isBlank使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isBlank函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: carerRels
get carerRels(): Iterable.Indexed<CarerRel> {
if (!isBlank(this.carer)) {
return this.dependent.carerRels
.filter(rel => rel.carer.id === this.carer.id)
.toIndexedSeq();
}
return this.dependent.carerRels;
}
示例2: remove
remove(fileNote: FileNote): Observable<any> {
if (isBlank(fileNote.id)) {
return Observable.of(true);
}
var request = this._requestFactory.delete(fileNote.id);
return request.send()
.handle({select: 200, decoder: this.modelCodec});
}
示例3: transform
transform(value:any, ...args: any[]):any {
if (isBlank(value) || value === '') {
var defaultValue = 'Unknown';
if (args.length > 0) {
defaultValue = args[0];
}
return defaultValue;
}
return value;
}
示例4: save
save(fileNote: FileNote): Observable<FileNote> {
if (isBlank(fileNote.id)) {
var request = this._requestFactory.post('', this.modelCodec);
request.setRequestBody(fileNote);
return request.send().handle({select: 201, decoder: this.modelCodec});
} else {
var request = this._requestFactory.put(fileNote.id, this.modelCodec);
request.setRequestBody(fileNote);
return request.send().handle({select: 200, decoder: this.modelCodec});
}
}
示例5: transform
transform(value: any, ...args: any[]) {
if (args.length === 0) {
throw new ArgumentError(
'Phone number pipe requires a format argument'
);
}
if (isBlank(value)) {
return value;
}
if (!isString(value)) {
throw new ArgumentError(`Not a string: ${value}`);
}
return formatPhoneNumber(value, args[0]);
}
示例6: transform
transform(value: any, args: any[]) {
if (isBlank(value))
return value;
if (value instanceof Address) {
let formatted = value.street;
if (value.city !== '') {
formatted += (', ' + value.city);
}
if (value.postcode !== '') {
formatted += ('\u00A0' + value.postcode);
}
return formatted;
}
throw new TypeError(`Not an address: ${value}`);
}
示例7: transform
transform(value: any, ...args: any[]): any {
if (isBlank(value))
return value;
if (value instanceof Name) {
if (!value.isAnonymous) {
return 'Anonymous';
}
var fmt = capitalizeFirstLetter(value.firstName);
fmt += ' ';
if (value.alias) {
fmt += `(${capitalizeFirstLetter(value.alias)})`;
fmt += ' '
}
fmt += capitalizeFirstLetter(value.lastName);
return fmt;
} else {
throw new ArgumentError(`Expected a 'Name', got: ${value}`);
}
}
示例8: hasPartner
get hasPartner(): boolean { return !isBlank(this.partner); }
示例9: isOpen
get isOpen(): boolean {
return !isBlank(this.options);
}