当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript attribute-utils.getAttrValue函数代码示例

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


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

示例1: getMode

  private getMode(this: LiveExampleComponent, attrs: AttrMap): typeof this.mode {
    const downloadOnly = boolFromValue(getAttrValue(attrs, 'downloadOnly'));
    const isEmbedded = boolFromValue(getAttrValue(attrs, 'embedded'));

    return downloadOnly ? 'downloadOnly'
           : isEmbedded ? 'embedded' :
                          'default';
  }
开发者ID:marclaval,项目名称:angular,代码行数:8,代码来源:live-example.component.ts

示例2: getExampleDir

 private getExampleDir(attrs: AttrMap, path: string) {
   let exampleDir = getAttrValue(attrs, 'name');
   if (!exampleDir) {
     // Take the last path segment, excluding query params and hash fragment.
     const match = path.match(/[^/?#]+(?=\/?(?:\?|#|$))/);
     exampleDir = match ? match[0] : 'index';
   }
   return exampleDir.trim();
 }
开发者ID:marclaval,项目名称:angular,代码行数:9,代码来源:live-example.component.ts

示例3: getEnableDownload

 private getEnableDownload(attrs: AttrMap) {
   const downloadDisabled = boolFromValue(getAttrValue(attrs, 'noDownload'));
   return !downloadDisabled;
 }
开发者ID:marclaval,项目名称:angular,代码行数:4,代码来源:live-example.component.ts

示例4: getTitle

 private getTitle(attrs: AttrMap) {
   return (getAttrValue(attrs, 'title') || 'live example').trim();
 }
开发者ID:marclaval,项目名称:angular,代码行数:3,代码来源:live-example.component.ts

示例5: getStackblitzName

 private getStackblitzName(attrs: AttrMap) {
   const attrValue = (getAttrValue(attrs, 'stackblitz') || '').trim();
   return attrValue && `${attrValue}.`;
 }
开发者ID:marclaval,项目名称:angular,代码行数:4,代码来源:live-example.component.ts


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