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+

  1. create directory app/reopens
  2. create file app/reopens/link-component.js

    import ember 'ember';  ember.linkcomponent.reopen({   attributebindings: ['data-variation', 'data-offset', 'data-content','data-any'] }); 
  3. in app.js import it

    import linkcomponent './reopens/link-component';

that's all. ember-cli < 2.0 replace linkcomponent linkview


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -