You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use ivh-treeview as a way of Filtering with Facets. I'm getting Facet counts back from Solr and am trying to append the counts to the appropriate node in the treeview.
I started playing with templates and noticed this disclaimer: "The template itself does not (currently) have access a transcluded scope."
I assume this is why I am unable to see the counts I am placing on $scope. I am currently trying to do this:
You are correct. The "transcluded" template option is right now really a convenience for passing a template string to the treeview directive - these templates behave just like those provided inline or through the global options. They do not have access to the transcluded scope and so can't see things you're placing on $scope.
I had initially hoped to support the behavior you're looking for but ran into issues and tabled it for the moment. IIRC it was something to do with the helper directives requiring ivhTeeview as a parent directive and not finding it when compiled independently by ivhTreeviewCompiler.
Apologies for the inconvenience, I do plan to revisit this once the v1 branch drops. For the moment you'd have to work around this by either sticking the count (or a way to get it) on the node directly, e.g. {{node.facetCounts}} or using a directive to get the counts from a service, e.g. <span what-facet-counts="node"></span>.
I'm trying to use ivh-treeview as a way of Filtering with Facets. I'm getting Facet counts back from Solr and am trying to append the counts to the appropriate node in the treeview.
I started playing with templates and noticed this disclaimer: "The template itself does not (currently) have access a transcluded scope."
I assume this is why I am unable to see the counts I am placing on $scope. I am currently trying to do this:
The text alludes to the fact that "currently" it does this. Is there a chance we can get access to $scope variables inside of the template?
Can I get access to $scope variables when I use global or inline templates?
The text was updated successfully, but these errors were encountered: