Skip to content

Instantly share code, notes, and snippets.

@sukima
Last active July 8, 2020 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sukima/b253861c74a4f5e1ca8d41d11a7a3999 to your computer and use it in GitHub Desktop.
Save sukima/b253861c74a4f5e1ca8d41d11a7a3999 to your computer and use it in GitHub Desktop.
ui-link-to Component OCTANE
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);
}
}
{{yield (hash
href=this.href
isActive=this.isActive
transitionTo=this.transitionTo
)}}
@sukima
Copy link
Author

sukima commented Jul 8, 2020

<UiLinkTo @route={{array "arg1" "arg2"}}>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment