github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/components/breadcrumb.js (about) 1 import { assert } from '@ember/debug'; 2 import { action } from '@ember/object'; 3 import { inject as service } from '@ember/service'; 4 import Component from '@glimmer/component'; 5 6 export default class Breadcrumb extends Component { 7 @service breadcrumbs; 8 9 constructor() { 10 super(...arguments); 11 assert('Provide a valid breadcrumb argument', this.args.crumb); 12 this.register(); 13 } 14 15 @action register() { 16 this.breadcrumbs.registerBreadcrumb(this); 17 } 18 19 @action deregister() { 20 this.breadcrumbs.deregisterBreadcrumb(this); 21 } 22 23 willDestroy() { 24 super.willDestroy(); 25 this.deregister(); 26 } 27 }