本文整理汇总了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);
}
示例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;
}
}
示例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;
}
示例4: toView
public toView(input: string): string {
const camel = PLATFORM.camelCase(input);
return camel.slice(0, 1).toUpperCase() + camel.slice(1);
}