I am trying to hide back button on site-header that takes me to dashboard. I am using pod structure that is something like this:
- pod
- component
- site-header
- template.hbs
- component.js
- site-header
- main
- dashboard
- component
In the component.js I used computed to get current route
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
export default Component.extend({
router: service (),
dashboard:computed('currentRouteName',function(){
if(this.get('currentRouteName') === 'main.dashboard.index'){
return true;
}
return false;
})
})
question from:https://stackoverflow.com/questions/65918044/need-to-show-hide-a-button-depending-on-the-page