jeudi 26 novembre 2015

how to use another controller method in ember

im' trying to use a method which is in application.js, is these a controller. it has a method called isAuthenticated which return if a user is login or not.

in my application.hbs it works fine, but when i call it in my posts/new.hbs it always return false. why it?

my application controller,

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'),
});

solutions?




Aucun commentaire:

Enregistrer un commentaire