• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript lang.isBlank函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中angular2/src/core/facade/lang.isBlank函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isBlank函数的具体用法?TypeScript isBlank怎么用?TypeScript isBlank使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了isBlank函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: _processAsPostChrome44Event

 private _processAsPostChrome44Event(event, categories) {
   var name = event['name'];
   var args = event['args'];
   if (this._isEvent(categories, name, ['devtools.timeline', 'v8'], 'MajorGC')) {
     var normArgs = {
       'majorGc': true,
       'usedHeapSize': isPresent(args['usedHeapSizeAfter']) ? args['usedHeapSizeAfter'] :
                                                              args['usedHeapSizeBefore']
     };
     return normalizeEvent(event, {'name': 'gc', 'args': normArgs});
   } else if (this._isEvent(categories, name, ['devtools.timeline', 'v8'], 'MinorGC')) {
     var normArgs = {
       'majorGc': false,
       'usedHeapSize': isPresent(args['usedHeapSizeAfter']) ? args['usedHeapSizeAfter'] :
                                                              args['usedHeapSizeBefore']
     };
     return normalizeEvent(event, {'name': 'gc', 'args': normArgs});
   } else if (this._isEvent(categories, name, ['devtools.timeline', 'v8'], 'FunctionCall') &&
              (isBlank(args) || isBlank(args['data']) ||
               (!StringWrapper.equals(args['data']['scriptName'], 'InjectedScript') &&
                !StringWrapper.equals(args['data']['scriptName'], '')))) {
     return normalizeEvent(event, {'name': 'script'});
   } else if (this._isEvent(categories, name, ['devtools.timeline', 'blink'],
                            'UpdateLayoutTree')) {
     return normalizeEvent(event, {'name': 'render'});
   } else if (this._isEvent(categories, name, ['devtools.timeline'], 'UpdateLayerTree') ||
              this._isEvent(categories, name, ['devtools.timeline'], 'Layout') ||
              this._isEvent(categories, name, ['devtools.timeline'], 'Paint')) {
     return normalizeEvent(event, {'name': 'render'});
   }
   return null;  // nothing useful in this event
 }
开发者ID:hankduan,项目名称:angular,代码行数:32,代码来源:chrome_driver_extension.ts


示例2: _format

 static _format(value: number, style: NumberFormatStyle, digits: string, currency: string = null,
                currencyAsSymbol: boolean = false): string {
   if (isBlank(value)) return null;
   if (!isNumber(value)) {
     throw new InvalidPipeArgumentException(NumberPipe, value);
   }
   var minInt = 1, minFraction = 0, maxFraction = 3;
   if (isPresent(digits)) {
     var parts = RegExpWrapper.firstMatch(_re, digits);
     if (isBlank(parts)) {
       throw new BaseException(`${digits} is not a valid digit info for number pipes`);
     }
     if (isPresent(parts[1])) {  // min integer digits
       minInt = NumberWrapper.parseIntAutoRadix(parts[1]);
     }
     if (isPresent(parts[3])) {  // min fraction digits
       minFraction = NumberWrapper.parseIntAutoRadix(parts[3]);
     }
     if (isPresent(parts[5])) {  // max fraction digits
       maxFraction = NumberWrapper.parseIntAutoRadix(parts[5]);
     }
   }
   return NumberFormatter.format(value, defaultLocale, style, {
     minimumIntegerDigits: minInt,
     minimumFractionDigits: minFraction,
     maximumFractionDigits: maxFraction,
     currency: currency,
     currencyAsSymbol: currencyAsSymbol
   });
 }
开发者ID:beta3000,项目名称:hola-angular2,代码行数:30,代码来源:number_pipe.ts


示例3:

 return templateBindings.map(binding => {
   if (binding.keyIsVar) {
     return '#' + binding.key + (isBlank(binding.name) ? '=null' : '=' + binding.name);
   } else {
     return binding.key + (isBlank(binding.expression) ? '' : `=${binding.expression}`)
   }
 });
开发者ID:hankduan,项目名称:angular,代码行数:7,代码来源:parser_spec.ts


示例4: _resolveUrl

/**
 * Resolves a URL.
 * @param {string} base The URL acting as the base URL.
 * @param {string} to The URL to resolve.
 * @return {string}
 */
function _resolveUrl(base: string, url: string): string {
  var parts = _split(encodeURI(url));
  var baseParts = _split(base);

  if (isPresent(parts[_ComponentIndex.Scheme])) {
    return _joinAndCanonicalizePath(parts);
  } else {
    parts[_ComponentIndex.Scheme] = baseParts[_ComponentIndex.Scheme];
  }

  for (var i = _ComponentIndex.Scheme; i <= _ComponentIndex.Port; i++) {
    if (isBlank(parts[i])) {
      parts[i] = baseParts[i];
    }
  }

  if (parts[_ComponentIndex.Path][0] == '/') {
    return _joinAndCanonicalizePath(parts);
  }

  var path = baseParts[_ComponentIndex.Path];
  if (isBlank(path)) path = '/';
  var index = path.lastIndexOf('/');
  path = path.substring(0, index + 1) + parts[_ComponentIndex.Path];
  parts[_ComponentIndex.Path] = path;
  return _joinAndCanonicalizePath(parts);
}
开发者ID:chiragjraval,项目名称:AdvisroySystemPOC,代码行数:33,代码来源:url_resolver.ts


示例5: createMetric

 function createMetric(perfLogs, microMetrics = null, perfLogFeatures = null, forceGc = null,
                       captureFrames = null) {
   commandLog = [];
   if (isBlank(perfLogFeatures)) {
     perfLogFeatures = new PerfLogFeatures({render: true, gc: true, frameCapture: true});
   }
   if (isBlank(microMetrics)) {
     microMetrics = StringMapWrapper.create();
   }
   var bindings = [
     Options.DEFAULT_PROVIDERS,
     PerflogMetric.BINDINGS,
     bind(Options.MICRO_METRICS).toValue(microMetrics),
     bind(PerflogMetric.SET_TIMEOUT)
         .toValue((fn, millis) => {
           commandLog.push(['setTimeout', millis]);
           fn();
         }),
     bind(WebDriverExtension)
         .toValue(new MockDriverExtension(perfLogs, commandLog, perfLogFeatures))
   ];
   if (isPresent(forceGc)) {
     bindings.push(bind(Options.FORCE_GC).toValue(forceGc));
   }
   if (isPresent(captureFrames)) {
     bindings.push(bind(Options.CAPTURE_FRAMES).toValue(captureFrames));
   }
   return Injector.resolveAndCreate(bindings).get(PerflogMetric);
 }
开发者ID:hankduan,项目名称:angular,代码行数:29,代码来源:perflog_metric_spec.ts


示例6: _sameDirIndex

function _sameDirIndex(a: ProtoRecord, b: ProtoRecord): boolean {
  var di1 = isBlank(a.directiveIndex) ? null : a.directiveIndex.directiveIndex;
  var ei1 = isBlank(a.directiveIndex) ? null : a.directiveIndex.elementIndex;

  var di2 = isBlank(b.directiveIndex) ? null : b.directiveIndex.directiveIndex;
  var ei2 = isBlank(b.directiveIndex) ? null : b.directiveIndex.elementIndex;

  return di1 === di2 && ei1 === ei2;
}
开发者ID:chiragjraval,项目名称:AdvisroySystemPOC,代码行数:9,代码来源:coalesce.ts


示例7: _parseChromeVersion

 private _parseChromeVersion(userAgent: string): number {
   if (isBlank(userAgent)) {
     return -1;
   }
   var v = StringWrapper.split(userAgent, /Chrom(e|ium)\//g)[2];
   if (isBlank(v)) {
     return -1;
   }
   v = StringWrapper.split(v, /\./g)[0];
   if (isBlank(v)) {
     return -1;
   }
   return NumberWrapper.parseInt(v, 10);
 }
开发者ID:hankduan,项目名称:angular,代码行数:14,代码来源:chrome_driver_extension.ts


示例8: kvChangesAsString

export function kvChangesAsString(
    {map, previous, additions, changes, removals}:
        {map?: any[], previous?: any[], additions?: any[], changes?: any[], removals?: any[]}):
    string {
  if (isBlank(map)) map = [];
  if (isBlank(previous)) previous = [];
  if (isBlank(additions)) additions = [];
  if (isBlank(changes)) changes = [];
  if (isBlank(removals)) removals = [];

  return "map: " + map.join(', ') + "\n" + "previous: " + previous.join(', ') + "\n" +
         "additions: " + additions.join(', ') + "\n" + "changes: " + changes.join(', ') + "\n" +
         "removals: " + removals.join(', ') + "\n";
}
开发者ID:hankduan,项目名称:angular,代码行数:14,代码来源:util.ts


示例9: transform

 transform(value: any, args: any[] = null): any {
   if (isBlank(args) || args.length == 0) {
     throw new BaseException('Slice pipe requires one argument');
   }
   if (!this.supports(value)) {
     throw new InvalidPipeArgumentException(SlicePipe, value);
   }
   if (isBlank(value)) return value;
   var start: number = args[0];
   var end: number = args.length > 1 ? args[1] : null;
   if (isString(value)) {
     return StringWrapper.slice(value, start, end);
   }
   return ListWrapper.slice(value, start, end);
 }
开发者ID:,项目名称:,代码行数:15,代码来源:


示例10:

 elementInjector.getDirectiveVariableBindings().forEach((directiveIndex, name) => {
   if (isBlank(directiveIndex)) {
     view.locals.set(name, view.elementRefs[boundElementIdx].nativeElement);
   } else {
     view.locals.set(name, elementInjector.getDirectiveAtIndex(directiveIndex));
   }
 });
开发者ID:beta3000,项目名称:hola-angular2,代码行数:7,代码来源:view_manager_utils.ts



注:本文中的angular2/src/core/facade/lang.isBlank函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript lang.isPresent函数代码示例发布时间:2022-05-25
下一篇:
TypeScript lang.isArray函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap