Chcę wiedzieć, jak wywołać działania, gdy wejście zostanie koncentruje ..
teraz używam to na moim szablonu: {{view "clickinput" class="form-control" placeholder="search..." value=s action="focus"}}
i to jak widok:Jak wywołać akcję, gdy wejście zostanie skupione?
export default Ember.TextField.extend({
onEvent: 'focusIn',
focusIn: function() {
this.sendAction('focusIn', this, event);
}
});
i to na mój kontroler:
actions: {
focus: function() {
alert('f');
}
}
ale to nie działa ..
otrzymuję ten błąd na chrome: Uncaught Error: Assertion Failed: The focusIn action was triggered on the component <[email protected]:clickinput::ember438>, but the action name (function superWrapper() { var ret, sup = this.__nextSuper; this.__nextSuper = superFunc; ret = func.apply(this, arguments); this.__nextSuper = sup; return ret; }) was not a string.
dlaczego?