Hi guys,
regarding Passing observables through properties, I would like to know how I get the value from (in this case) passedInObservable
variable.
For example, in my case I want to pass an Object like this { year: 2017, month: 1, day: 3 }
.
I have a property on my Component
<object ux:Property="DateToShow"/>
And my component is “called” like this:
<Tim.MyComponent DateToShow ="{dateToShow}"/>
where dateToShow
is an observable with the value above.
In my component I have
var dateToShow = this.DateToShow;
and the output is:
{
"_origin": -159,
"_subscribers": [{
"version": 2,
"active": true
}],
"_isProxy": false,
"_values": [{
"_origin": -180,
"_subscribers": [{
"version": 2,
"active": true
}, {
"version": 2,
"active": true
}],
"_isProxy": false,
"_values": [{
"year": 2017,
"month": 1,
"day": 3
}],
"_beganSubscriptions": true
}],
"_beganSubscriptions": true
}
Note: if I use var dateToShow = this.DateToShow.inner();
it outputs
{
"_origin": -161,
"_subscribers": [],
"_isProxy": true,
"_values": [],
"_subscriptionWatchers": [{
"watcherId": 18
}]
}
If I try dataToShow.value
it returns Fuse.Scripting.JavaScriptCore.Object
. In a desperate attempt I’ve tried dataToShow.value.value
, still the same output.
On the other hand, if the Property
type is a string
it all works like a charm.
I’m guessing this happens because “If we pass an Observable in, this.Propertyname
will contain an observable with the observable we passed through.”
So how do I get the value from that observable? There is a better way to do this?