Hola, tengo 2 variantes de código, ambas no funcionan. Mi problema es que quiero pasar un argumento al controlador del método addBinding. console.log(x) regresa como debería ser, pero cuando se pasa al controlador, el problema es que el argumento para esa función es el mismo para todos los enlaces y quiero tener una base diferente en tagValue (tagValue = argumento que quiero en la función). ¿Qué está mal? Publicando 2 variantes de código (es bueno mencionar que, por ejemplo, la clave está vinculada sin ningún problema, solo el controlador tiene problemas):
for (j = 0, len = ref1.length; j < len; j++) { tag = ref1[j]; if (tag.key !== void 0) { tagValue = name + "/" + tag.label; tagKey = tag.key; tagg = tag.label; x = "this.onTagHotkey('" + ("" + tagValue) + "');"; console.log(x); map.addBinding({ key: "" + tagKey, scope: this, handler: function() { return eval(x); #problem here } }); console.log(map); }o
for (j = 0, len = ref1.length; j < len; j++) { tag = ref1[j]; if (tag.key !== void 0) { tagValue = name + "/" + tag.label; tagKey = tag.key; tagg = tag.label; map.addBinding({ key: "" + tagKey, scope: this, handler: function() { return this.onTagHotkey(tagValue); #problem here } }); console.log(map); }