Ember.js: action with explicit target fails -


i guess i'm missing basic, following fails the action 'login' did not exist on app.appcontroller.

template:

<h2>click button , watch console</h2> <button type="button" {{action login target="app.appcontroller"}}>log in</button> 

controller:

app.appcontroller = ember.controller.extend({   login: function() {     // never gets here     debugger;   },   send: function() {     // or here     debugger;   } }); 

jsbin: http://jsbin.com/okuqiv/5/edit (this pointing ember latest, it's same behavior 1.0-rc2, version i've been using couple of days; haven't tried on previous versions).

upon debugging, seems somehow controller mixin not exposing functions should -- login() function added, send() ember function. it's missing other functions get().

i saw in app login() function exists on object app.appcontroller.prototype, while in jsbin exists on 1 of objects in mixin chain.

at point i'd happy handle login action in view, or router (as seems default in past), none of seem work.

from documentation, current default place actions handlers should live controller anyway, , routes, if remove target , add login() route, error: nothing handled event 'login' (i'm using target in first place because in app /login separate route , has different controller).

solutions , workaround appreciated!

you targeting class app.appcontroller , not actual instance of class. if using router , in app view action target appcontroller default.

i've updated jsbin call login on indexcontroller since example in index route:

http://jsbin.com/okuqiv/10/

you on riding send method preventing login being called.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -