jeudi 2 avril 2020

Ember Octane Logout button disappears

I am upgrading to Ember Octane and I modified the template HBS to call the component JS. When I use Ember Classic, the Logout button exists and works. But, when I convert to Octane then the Logout button disappears. o_O

What is the correct way to display a Logout button on the template HBS? Note: I do not have a component HBS file. Is this required in Ember Octane?

Classic Template HBS snippet:

<li><a href="#" onclick=>Logout</a></li>

Octane Template HBS snippet:

<li><a href="#" onclick=>Logout</a></li>

Octane Component JS (works with Classic Template, but not Octane Template):

import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';

export default class Navigation extends Component {    

    @service session
    @service currentClient

    @action
    logout(ev) {

        ev.preventDefault();

            this.session.invalidate();
    }
}



Aucun commentaire:

Enregistrer un commentaire