How to ignore properties that doesn't exist in Binding?
-
I'm binding some properties to
Loader.item
.Loader { id: loader sourceComponent: comp Binding { target: loader.item property: "prop" value: 1 when: loader.status === Loader.Ready } }
If
loader.item
doesn't hasprop
, then theBinding
should do nothing, otherwise, pass the value toloader.item
. Note that you can't do likeBinding { ... when: loader.status === Loader.Ready && loader.item.prop !== undefined }
Because you can't assume that the value of
loader.item.prop
is not undefined.