From 42c09e41f2f7e5e432242c2cc993d4b6c3e81c01 Mon Sep 17 00:00:00 2001 From: Dan Wenzel Date: Wed, 1 Apr 2020 14:32:38 -0500 Subject: [PATCH 1/2] Include more details on how this addon works --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2bbd5be..b885e1d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # ember-href-to -A lightweight alternative to `{{link-to}}`. No components, no class bindings - just a bound anchor href and a click handler. +This add-on: +- Intercepts all `` tags, performing in-app route transitions if recognized, normal links otherwise. +- Provides an `{{href-to}}` helper as a lightweight alternative to `{{link-to}}`. No components, no class bindings - just a bound anchor href and a click handler. [![Build Status](https://travis-ci.org/intercom/ember-href-to.svg)](https://travis-ci.org/intercom/ember-href-to) [![Ember Observer Score](http://emberobserver.com/badges/ember-href-to.svg)](http://emberobserver.com/addons/ember-href-to) @@ -18,7 +20,9 @@ This is an Ember CLI addon, to install: ## Usage Instructions -`{{href-to}}` has the same interface as [`{{link-to}}`](https://guides.emberjs.com/v2.16.0/templates/links/), you can use it to link to static and dynamic routes in your ember application: +Once installed, this add-on will automatically intercept all `` tags. Once clicked, if the href url is recognized as a route found within the current Ember application, it will perform an Ember transition without a page refresh. If not, it will link to the url as a normal anchor tag. + +You can use the `{{href-to}}` helper, which has the same interface as [`{{link-to}}`](https://guides.emberjs.com/v2.16.0/templates/links/), to link to static and dynamic routes in your ember application: ```html Go Home @@ -33,6 +37,8 @@ This is an Ember CLI addon, to install: ``` +**WARNING: This add-on intercepts _all_ `` tags, not just ones that use the `{{href-to}}` helper. Be careful to check that external urls are still working correctly.** + As `{{href-to}}` simply generates a URL, you won't get automatic `active` class bindings as you do with `{{link-to}}`. Clicking on a `{{href-to}}` URL will trigger a full router transition though: ![href-to2](https://cloud.githubusercontent.com/assets/2526/8709271/0a8b934a-2b39-11e5-8f24-89ece7d6c45d.gif) From 86da4d850703cd779673da18beddef39a1cc0d78 Mon Sep 17 00:00:00 2001 From: Dan Wenzel Date: Wed, 1 Apr 2020 14:47:57 -0500 Subject: [PATCH 2/2] Update link-to guides link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b885e1d..58e3312 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This is an Ember CLI addon, to install: Once installed, this add-on will automatically intercept all `` tags. Once clicked, if the href url is recognized as a route found within the current Ember application, it will perform an Ember transition without a page refresh. If not, it will link to the url as a normal anchor tag. -You can use the `{{href-to}}` helper, which has the same interface as [`{{link-to}}`](https://guides.emberjs.com/v2.16.0/templates/links/), to link to static and dynamic routes in your ember application: +You can use the `{{href-to}}` helper, which has the same interface as [`{{link-to}}`](https://guides.emberjs.com/release/routing/linking-between-routes/), to link to static and dynamic routes in your ember application: ```html Go Home