ember.js - Extending {{link-to}} with Ember-cli -
this question similar unanswered extending link-to.
i'm trying extend {{link-to}}
helper output additional attribute bindings. attributes not appear in our html. heres have:
//views/link-to.js (normally coffeescript) import ember 'ember' var linktoview = ember.linkview.reopen({ attributebindings: ['data-toggle', 'data-placement', 'title'] }); export default linktoview;
the rendered output this:
define('app/views/link-to', ['exports', 'ember'], function (exports, ember) { 'use strict'; var linktoview; linktoview = ember['default'].linkview.reopen({ attributebindings: ['data-toggle', 'data-placement', 'title'] }); exports['default'] = linktoview; });
when called , rendered output:
// .hbs file {{#link-to 'account' class='header-link' data-toggle='tooltip' data-placement='right' title='account' }} <span class="glyphicon glyphicon-cog" aria-hidden="true"></span> {/link-to}} // rendered... <a id="ember615" class="ember-view header-link" href="/account" title="account"> <span class="glyphicon glyphicon-cog" aria-hidden="true"></span> </a>
where going wrong? know has resolver or how we're calling it.
thanks.
for ember 2.0+
- create directory app/reopens
create file app/reopens/link-component.js
import ember 'ember'; ember.linkcomponent.reopen({ attributebindings: ['data-variation', 'data-offset', 'data-content','data-any'] });
in app.js import it
import linkcomponent './reopens/link-component';
that's all. ember-cli < 2.0 replace linkcomponent linkview
Comments
Post a Comment