MCPcopy Create free account
hub / github.com/aurelia/binding / bind

Method bind

src/ast.js:50–64  ·  view source on GitHub ↗
(binding, scope, lookupFunctions)

Source from the content-addressed store, hash-verified

48 }
49
50 bind(binding, scope, lookupFunctions) {
51 if (this.expression.expression && this.expression.bind) {
52 this.expression.bind(binding, scope, lookupFunctions);
53 }
54 let behavior = lookupFunctions.bindingBehaviors(this.name);
55 if (!behavior) {
56 throw new Error(`No BindingBehavior named "${this.name}" was found!`);
57 }
58 let behaviorKey = `behavior-${this.name}`;
59 if (binding[behaviorKey]) {
60 throw new Error(`A binding behavior named "${this.name}" has already been applied to "${this.expression}"`);
61 }
62 binding[behaviorKey] = behavior;
63 behavior.bind.apply(behavior, [binding, scope].concat(evalList(scope, this.args, binding.lookupFunctions)));
64 }
65
66 unbind(binding, scope) {
67 let behaviorKey = `behavior-${this.name}`;

Callers

nothing calls this directly

Calls 3

bindingBehaviorsMethod · 0.80
evalListFunction · 0.70
bindMethod · 0.65

Tested by

no test coverage detected