@carlitoxti wrote:
Hello, i need to call a method who is define in my application controller since a route, post/comment/new route because i like to deny access this route for users are not authenticated.
import Ember from 'ember'; import App from '../app'; export default Ember.Controller.extend({ authManager: App.AuthManager, currentUser: function() { return App.AuthManager.get('apiKey.user'); }.property('authManager.apiKey'), isAuthenticated: function() { return App.AuthManager.isAuthenticated(); }.property('authManager.apiKey'), });
in my applycation.hbs, i have: {{#if isAuthenticated}} and it respond NO, BUT if a call this method in my post/comment/new.hbs it respon yes, i think it because in the if this method is not declared, so how i do that? thanks
Posts: 2
Participants: 2