It's a bit hard for me to test right now, but I think you're running into issues because you're reaching down the route hierarchy. For the most part, Ember controllers/routes are allowed to access properties of their parent objects, but not their children objects. (Which makes sense, because it's possible for the parent to be active but not the child.)
I think that instead of having the isLogin
property in LoginController
, put it in ApplicationController
. Then, in the places you need it, create an alias:
App.ApplicationController = Em.ObjectController.extend({
isLogin: false
});
App.LoginController = Em.ObjectController.extend({
needs: ['application'],
isLogin: Em.computed.alias('controllers.application.isLogin')
});
This follows Ember idioms more closely and I think will solve your problem.