本文整理匯總了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);
}