You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui-v2/app/helpers/is-href.js

16 lines
416 B

/*eslint ember/no-observers: "warn"*/
// TODO: Remove ^
import Helper from '@ember/component/helper';
import { inject as service } from '@ember/service';
import { observer } from '@ember/object';
export default Helper.extend({
router: service('router'),
compute(params) {
return this.router.isActive(...params);
},
onURLChange: observer('router.currentURL', function() {
this.recompute();
}),
});