【发布时间】:2014-07-30 10:46:53
【问题描述】:
目前我面临的问题是我需要在我自己的一个控制器中使用来自 ember-simple-auth (https://github.com/simplabs/ember-simple-auth/) 的 invalidateSession() 操作。
我通常像他们在示例中那样使用它:{{ action 'invalidateSession' }} 在我的车把模板中。在我打电话给invalidateSession() 之前,我需要做一些preLogout 的事情,所以需要有一种方法 - 但目前我不知道该怎么做。
模板:
{{ action 'preLogout' target='view' }}
查看:
actions:{
preLogout:function(){
this.get("controller").send("preLogout");
}
}
控制器:
actions:{
preLogout: function(){
var self = this;
//some preLogout things to do
//INVALIDATESESSION - how?
this.transitionToRoute("index");
}
谢谢
【问题讨论】:
标签: ember.js handlebars.js ember-simple-auth