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


TypeScript PLATFORM.camelCase方法代码示例

本文整理汇总了TypeScript中@aurelia/kernel.PLATFORM.camelCase方法的典型用法代码示例。如果您正苦于以下问题:TypeScript PLATFORM.camelCase方法的具体用法?TypeScript PLATFORM.camelCase怎么用?TypeScript PLATFORM.camelCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@aurelia/kernel.PLATFORM的用法示例。


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

示例1: bindLetElement

  private bindLetElement(parentManifest: IElementSymbol, node: HTMLElement): void {
    const symbol = new LetElementSymbol(this.dom, node);
    parentManifest.childNodes.push(symbol);

    const attributes = node.attributes;
    let i = 0;
    while (i < attributes.length) {
      const attr = attributes[i];
      if (attr.name === 'to-view-model') {
        node.removeAttribute('to-view-model');
        symbol.toViewModel = true;
        continue;
      }
      const attrSyntax = this.attrParser.parse(attr.name, attr.value);
      const command = this.resources.getBindingCommand(attrSyntax);
      const bindingType = command === null ? BindingType.Interpolation : command.bindingType;
      const expr = this.exprParser.parse(attrSyntax.rawValue, bindingType);
      const to = PLATFORM.camelCase(attrSyntax.target);
      const info = new BindableInfo(to, BindingMode.toView);
      symbol.bindings.push(new BindingSymbol(command, info, expr, attrSyntax.rawValue, to));

      ++i;
    }
    node.parentNode.replaceChild(symbol.marker as Node, node);
  }
开发者ID:aurelia,项目名称:aurelia,代码行数:25,代码来源:template-binder.ts

示例2: getTarget

export function getTarget(binding: PlainAttributeSymbol | BindingSymbol, camelCase: boolean): string {
  if (binding.flags & SymbolFlags.isBinding) {
    return (binding as BindingSymbol).bindable.propName;
  } else if (camelCase) {
    return PLATFORM.camelCase((binding as PlainAttributeSymbol).syntax.target);
  } else {
    return (binding as PlainAttributeSymbol).syntax.target;
  }
}
开发者ID:aurelia,项目名称:aurelia,代码行数:9,代码来源:binding-command.ts

示例3: getAttributeInfo

 /**
  * Retrieve information about a custom attribute resource.
  *
  * @param syntax The parsed `AttrSyntax`
  *
  * @returns The resource information if the attribute exists, or `null` if it does not exist.
  */
 public getAttributeInfo(syntax: AttrSyntax): AttrInfo | null {
   const name = PLATFORM.camelCase(syntax.target);
   let result = this.attributeLookup[name];
   if (result === undefined) {
     const def = this.resources.find(CustomAttributeResource, name);
     if (def === null) {
       result = null;
     } else {
       result = createAttributeInfo(def);
     }
     this.attributeLookup[name] = result;
   }
   return result;
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:21,代码来源:resource-model.ts

示例4: toView

 public toView(input: string): string {
   const camel = PLATFORM.camelCase(input);
   return camel.slice(0, 1).toUpperCase() + camel.slice(1);
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:4,代码来源:startup.ts


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