I am running into an error with how initial signal values are being parsed. Based on your examples here, I should be able to do this:
val person = dataSignals("person" to "{name: 'John Doe', age: 18}")
but the person signal gets initialized to a string, not a js object. heres an example:
div {
dataSignal("test1", "{child1: 'value', child2: 1}")
dataSignals("test2" to "{child1: 'value', child2: 1}")
input {
dataBind("test1.child1")
}
input {
dataBind("test2.child1")
}
}
the html generated looks like this (note the single quotes wrapping test1 and tes2 contents):
<div data-signals="{test1: '{child1: \'value\', child2: 1}'}" data-signals="{test2: '{child1: \'value\', child2: 1}'}">
<input data-bind="test1.child1">
<input data-bind="test2.child1">
</div>
when the signals are displayed using
pre {
dataJsonSignals({ Unit }) { }
}
it creates the nested signal path itself, blowing away the entire contents of test1 and test2 signals due to them being initialized as strings and prints the following:
"test1": {
"child1": ""
},
"test2": {
"child1": ""
},
I am running into an error with how initial signal values are being parsed. Based on your examples here, I should be able to do this:
val person = dataSignals("person" to "{name: 'John Doe', age: 18}")but the person signal gets initialized to a string, not a js object. heres an example:
the html generated looks like this (note the single quotes wrapping test1 and tes2 contents):
when the signals are displayed using
it creates the nested signal path itself, blowing away the entire contents of test1 and test2 signals due to them being initialized as strings and prints the following: