ember-link-to-wrapper
An anchor wrapped in a list item. That's all. Useful for working with bootstrap which wants the active
class on the <li>
.
Because ember-cli-active-link-wrapper has some issues on ember 2.10+.
Installation
ember install ember-link-to-wrapper
Usage
Use {{link-to-wrapper}}
as a drop-in replacement for {{link-to}}
:
The template will produce roughly this html:
<li>
<a href="/my-route">
Visit my route!
</a>
</li>
When the route is active, an active
class is applied to both elements:
<li class="active">
<a href="/my-route" class="active">
Visit my route!
</a>
</li>
Query parameters
Pass model arguments and query params as usual:
Inline form
The inline form is also supported:
Custom attributes
Use linkComponent
to customize the inner anchor element:
Produces roughly this html:
<li class="outer">
<a href="/my-route" class="inner">
Visit my route!
</a>
</li>
Development
-
git clone <repository-url>
this repository cd ember-link-to-wrapper
yarn install
Running
ember serve
- Visit your app at http://localhost:4200.
Running Tests
-
yarn test
(Runsember try:each
to test your addon against multiple Ember versions) ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit https://ember-cli.com/.