The fiddle is here
{{Data.x}} does not work. 5 does not display.
{{Data.y.prop1}} works. 6 is displayed
Why is that ? Whats the difference in the way the two properties are referenced ?
The fiddle is here
{{Data.x}} does not work. 5 does not display.
{{Data.y.prop1}} works. 6 is displayed
Why is that ? Whats the difference in the way the two properties are referenced ?
{{Data.y.prop1}}
Data.y
has a sub property which is prop1
and it contain a value which is 6
{{Data.x}}
In this case Data.x
either doesn't have a value at all OR it has a sub property which contains the value like in above mentioned example.
It's because your assigning to the wrong variable. You want to change Trade
but you assigned it to the local variable obj
.
obj = {
x: a,
y: b
}
This should be changed as:
this.Trade = {
x: a,
y: b
}
or
this.Trade.x = a;
this.Trade.x = b;
If you wanna know why it worked in y
, refer to this thread accepted answer for it will give you a clear answer.