Open wongpeiyi opened 9 years ago
Yes, this is a Javascript quirk. this
in toModel
always contains the new model, but if there is none, it is undefined, but vanilla Javascript doesn't let this
be undefined, and so replaces it with window
.
This is a poor part of the API that I would like to improve, it was a mistake to use this
here, for just this reason.
Thanks. Is there a reason why there is no model though? I modified the example so both routes contain a model.
@ef4 I'm not sure but should this not be liquidContext
? For liquid-outlets, it appears that _liquidChildFor
is called after _viewProperties
hence get('liquidContext')
returns undefined
instead of the new view's context
http://jsbin.com/dohizofico/1/edit (have to download and reference liquid-fire properly)
I modified the prebuilt-example to include DS models in the routes, and use a
toModel
function in the transition. However,this == window
in thetoModel
function andtoModel == undefined
in thefromModel
function.