Last active
July 8, 2020 21:10
-
-
Save sukima/b253861c74a4f5e1ca8d41d11a7a3999 to your computer and use it in GitHub Desktop.
ui-link-to Component OCTANE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '@glimmer/component'; | |
import { inject as service } from '@ember/service'; | |
import { action } from '@ember/object'; | |
export default class UiLinkTo extends Component { | |
@service router; | |
get href() { | |
return this.router.urlFor(...this.route); | |
} | |
get isActive() { | |
return this.router.isActive(...this.route); | |
} | |
@action | |
transitionTo() { | |
this.router.transitionTo(...this.route); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
<UiLinkTo @route={{array "arg1" "arg2"}}>