當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。