These are chat archives for ractivejs/ractive

4th
May 2018
Arnaud Dagnelies
@dagnelies
May 04 2018 09:27
quick question: in a decorator, can you know what keypath/rootpath you are in?
Paul Maly
@PaulMaly_twitter
May 04 2018 10:55
I usually pass keypath as a string manually
Joseph
@fskreuz
May 04 2018 13:17
A decorator is given a reference to the node it's attached to. You can use Ractive.getContext() to get the context of that node. Now if I remember correctly, to get the context keypath, you use context.resolve() without args to get the keypath.
Arnaud Dagnelies
@dagnelies
May 04 2018 14:49
Thanks @fskreuz , I'll try
Chris Reeves
@evs-chris
May 04 2018 14:58
yep, that's the route I usually take, though with the context for prefixed (., ../, etc) get, set, and friends, the actual keypath is much less useful