本文整理汇总了TypeScript中angular2/src/facade/lang.isPresent函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isPresent函数的具体用法?TypeScript isPresent怎么用?TypeScript isPresent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isPresent函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
asts.forEach(ast => {
var astResult = ast.visit(visitor, context);
if (isPresent(astResult)) {
result.push(astResult);
}
});
示例2: isPresent
binding => isPresent(binding.expression) ? binding.expression.source : null);
示例3: composeAsyncValidators
export function composeAsyncValidators(
validators: /* Array<Validator|Function> */ any[]): AsyncValidatorFn {
return isPresent(validators) ? Validators.composeAsync(validators.map(normalizeAsyncValidator)) :
null;
}
示例4: addChild
addChild(child: DebugNode) {
if (isPresent(child)) {
this.childNodes.push(child);
child.parent = this;
}
}
示例5: buildNodeProviders
export function buildNodeProviders(providers?: Array<any>): Array<any> {
return [
...NODE_PROVIDERS,
...(isPresent(providers) ? providers : [])
];
}
示例6: ngForOf
set ngForOf(value: any) {
this._ngForOf = value;
if (isBlank(this._differ) && isPresent(value)) {
this._differ = this._iterableDiffers.find(value).create(this._cdr);
}
}
示例7: ngDoCheck
ngDoCheck() {
if (isPresent(this._differ)) {
var changes = this._differ.diff(this._ngForOf);
if (isPresent(changes)) this._applyChanges(changes);
}
}
示例8: _resolveView
function _resolveView(viewRef) {
return isPresent(viewRef) ? viewRef.delegate : null;
}
示例9: _resolveProtoView
function _resolveProtoView(protoViewRef) {
return isPresent(protoViewRef) ? protoViewRef.delegate : null;
}
示例10: constructor
constructor(lexer: Lexer, providedReflector: Reflector = null) {
this._lexer = lexer;
this._reflector = isPresent(providedReflector) ? providedReflector : reflector;
}