Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private declareTemplateController(attrSyntax: AttrSyntax, attrInfo: AttrInfo): TemplateControllerSymbol {
let symbol: TemplateControllerSymbol;
// dynamicOptions logic here is similar to (and explained in) bindCustomAttribute
const command = this.resources.getBindingCommand(attrSyntax, false);
if (command == null && attrInfo.hasDynamicOptions) {
symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
} else {
symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
const bindingType = command == null ? BindingType.Interpolation : command.bindingType;
const expr = this.exprParser.parse(attrSyntax.rawValue, bindingType);
symbol.bindings.push(new BindingSymbol(command, attrInfo.bindable, expr, attrSyntax.rawValue, attrSyntax.target));
}
return symbol;
}
declareTemplateController(attrSyntax, attrInfo) {
if (Tracer.enabled) {
Tracer.enter('TemplateBinder', 'declareTemplateController', slice.call(arguments));
}
let symbol;
// dynamicOptions logic here is similar to (and explained in) bindCustomAttribute
const command = this.resources.getBindingCommand(attrSyntax);
if (command == null && attrInfo.hasDynamicOptions) {
symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
this.partName = null;
this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
}
else {
symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
const bindingType = command == null ? 2048 /* Interpolation */ : command.bindingType;
const expr = this.exprParser.parse(attrSyntax.rawValue, bindingType);
symbol.bindings.push(new BindingSymbol(command, attrInfo.bindable, expr, attrSyntax.rawValue, attrSyntax.target));
this.partName = null;
}
if (Tracer.enabled) {
Tracer.leave();
}
return symbol;
}
bindCustomAttribute(attrSyntax, attrInfo) {
declareTemplateController(attrSyntax, attrInfo) {
if (Tracer.enabled) {
Tracer.enter('TemplateBinder', 'declareTemplateController', slice.call(arguments));
}
let symbol;
// dynamicOptions logic here is similar to (and explained in) bindCustomAttribute
const command = this.resources.getBindingCommand(attrSyntax);
if (command == null && attrInfo.hasDynamicOptions) {
symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
this.partName = null;
this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
}
else {
symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
const bindingType = command == null ? 2048 /* Interpolation */ : command.bindingType;
const expr = this.exprParser.parse(attrSyntax.rawValue, bindingType);
symbol.bindings.push(new BindingSymbol(command, attrInfo.bindable, expr, attrSyntax.rawValue, attrSyntax.target));
this.partName = null;
}
if (Tracer.enabled) {
Tracer.leave();
}
return symbol;
}
bindCustomAttribute(attrSyntax, attrInfo) {
private declareTemplateController(attrSyntax: AttrSyntax, attrInfo: AttrInfo): TemplateControllerSymbol {
let symbol: TemplateControllerSymbol;
// dynamicOptions logic here is similar to (and explained in) bindCustomAttribute
const command = this.resources.getBindingCommand(attrSyntax, false);
if (command == null && attrInfo.hasDynamicOptions) {
symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
this.bindMultiAttribute(symbol, attrInfo, attrSyntax.rawValue);
} else {
symbol = new TemplateControllerSymbol(this.dom, attrSyntax, attrInfo, this.partName);
const bindingType = command == null ? BindingType.Interpolation : command.bindingType;
const expr = this.exprParser.parse(attrSyntax.rawValue, bindingType);
symbol.bindings.push(new BindingSymbol(command, attrInfo.bindable, expr, attrSyntax.rawValue, attrSyntax.target));
}
return symbol;
}