These are chat archives for ractivejs/ractive

11th
Mar 2015
Tim Oxley
@timoxley
Mar 11 2015 01:18
hm, why does the _ractive property need to be attached to everything?
I have some apis that produce frozen data, can't use it with ractive at all :(
Tim Oxley
@timoxley
Mar 11 2015 01:48
ahh there's writing on array proto as well. I guess frozen data is out of the question.
ahh modifyArrays
Martin Kolárik
@MartinKolarik
Mar 11 2015 02:36
@constantx If you don't use restricted references, and don't set any default values, the binding will resolve to the root context, which is probably causing your problem. See this jsfiddle and docs for more info.
@timoxley yes, modifyArrays is what you were looking for
Tim Oxley
@timoxley
Mar 11 2015 03:38
oh man
having major issues over here.
Ractive doesn't seem to be very happy removing array items
seems to be something around array of components with nested components
and maybe object iteration
Tim Oxley
@timoxley
Mar 11 2015 03:43
if I remove this nesty element, ractive appears to get confused about whose data belongs to whom and starts writing data from other elements into each other
oh god
Truong Nguyen
@constantx
Mar 11 2015 18:17
@MartinKolarik thanks for the super tip!
Truong Nguyen
@constantx
Mar 11 2015 18:32
@MartinKolarik by root context, do you mean the top most instance of the render tree where the component is a child of?
Martin Kolárik
@MartinKolarik
Mar 11 2015 18:49
@constantx yes.
@timoxley if you think there's a bug in Ractive, please file an issue on GitHub.
Truong Nguyen
@constantx
Mar 11 2015 18:51
so if I don’t want to predefine the key in data, but still want it to be restricted to the current instance, I should just use {{ this.myDynamicKey }}?
Martin Kolárik
@MartinKolarik
Mar 11 2015 19:18
if you want to restrict it to the instance, use http://docs.ractivejs.org/latest/options#isolated
using this.myDynamicKey will restrict it to the current context, i.e. {{#foo}} {{this.myDynamicKey}} {{/foo}} === {{foo.myDynamicKey}}
Truong Nguyen
@constantx
Mar 11 2015 19:21
I actually need {{#this.myDynamicKey}}{{name}}{{/}}
it’s working like that, so I’ll go with it
can’t use isolated mode in some cases where I still need access to parent’s scope :(
Truong Nguyen
@constantx
Mar 11 2015 19:28
bad architect on my end :) will have to refactor later