I have a class definition…
class anObj {
"ID" : string;
dialog: {[id : number]:{hide: boolean;}} = {
0 : {"hide": false},
14 : {"hide": false}
}
}
class manyObjects {
myGroup: anObj [] = [];
}
...
public stuff = manyObjects;
This totally works just the way I'd like for it to...I can use the id value as a direct key...
var x:number = 1 //used for a different tier of logic
stuff.myGroup[x].dialog[14].hide!=true
Here's where I'm stuck... I'd like to add more dialogs to the group. I get all the way our to...
stuff.myGroup[x].dialog
and can't figure out how to add something like with a push...
.push(7 : {"hide": true})
for example, I can type this line and the IDE says it's ok...
stuff.myGroup[x].dialog[[id=7].push({"hide": false})];
however, when I check, the element does not get added to the array...
.push()modifies the original array, and doesn't return the new array.