Skip to content

Instantly share code, notes, and snippets.

@trabus
Created October 30, 2015 17:24
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 trabus/142cb875f1e80c94ef10 to your computer and use it in GitHub Desktop.
Save trabus/142cb875f1e80c94ef10 to your computer and use it in GitHub Desktop.

In 1.13.0-beta.1 and above, the childViews array is not maintained (HTMLBars maintains a tree structure instead of a flat array listing).

I spiked getting things working for both pre-1.13 and post in this JSBin, snippet below:

  didRender: function() { 
    function filterAttrMorphs(node) {
      return node.constructor.name !== 'AttrMorph';
    }
    var childViews = this._renderNode.childNodes.filter(filterAttrMorphs)[0].childNodes
    .map(function(node) {
      return node.emberView;
    });

    this.set('childViews', Ember.A(childViews));
  }

Context:

alexspeller/ember-cli-active-link-wrapper#4 emberjs/ember.js#11244

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