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 think only view is really needed, to access values outside current scope (parent/root) from view function.
Access outside scope from template itself - as discussed in #399 - is problematic, because it breaks compatibility, but functions must be JS-specific anyway, so could it be done there?
I currently use very simple patch of mustache.js (4.2.0) on line 471:
{{id}} {# will output node.id #}
{{#children}}
{{id}} {# will output node.children[i].id #}
{{root_id}} {# will output node.id #}
{{/children}}
(Of course real world situations usually need to access some flag or value to perform calculations with.)
I'm not sure if this change is safe/reliable and I don't really care in which way it would be implemented, just having the possibility to access "root" view from function would really help.
The text was updated successfully, but these errors were encountered: