【发布时间】:2015-11-21 18:58:41
【问题描述】:
我正在使用Ember-simple-auth 来验证我的路线,并且工作正常。我有:
login - login route
index - after login in ok
我正在使用 ember-cli-notification 弹出此消息:
"Welcome USER NAME"
像这样,在IndexController中:
export default Ember.Controller.extend({
init () {
this.notifications.addNotification({
message: 'Welcome USER NAME',
type: 'success',
autoClear: true,
clearDuration: 5000
});
}
});
我想问...如何访问当前登录用户的属性?我在一个完全不同的控制器中,所以我不知道该怎么做......
而且.. 我想问一下是否可能.. 我正在为此使用 init 函数.. 我做得对吗?
谢谢。
【问题讨论】:
标签: javascript ember.js ember-simple-auth