Cannot see Property/State of a tuple dictionary
Augury version (required): 1.3.0 Angular version (required): 2.4.9 Date: 2017-03-10 OS: macOS Sierra 10.12.3
Code snippet:
export class Connection {
constructor() {
this.groups = [];
}
id: string;
name: string;
groups?: IConnectionGroup[]
}
export interface IConnectionGroup {
0: string,
1: IConnectionAttribute[]
}
export interface IConnectionAttribute {
displayName: string;
value: string;
path: string;
}
in the main app
let connection : Connection = {};
let groups: IConnectionGroup['TestGroup'] = [{ displayName: "MockName", value: "Mock Value", path: "Mock path"}];
connection.groups = groups;
console.log(connection); // compare this with Property -> State, you won't see anything within groups
Description of issue:
+1 I cannot see it in the properties/state panel but I am able to see the object in the chrome console, see below the groups property:

In the regular console, same groups property that was printed using console.log():

Steps to reproduce:
- Use the code snippet above
- Run the app and use console.log to print the Connection object
- Compare the
groupsproperty, you can see values into the browser console but you won't in Augury Property/State values
@sballarati Can you let me know if this persists with 1.5.0 (just released)? I fixed several errors in the serialization so hopefully it was caught, but otherwise see if you can isolate it in a reproducible way for me.
@sballarati Ahh I looked closer and realized I had assumed you were doing something much simpler. I tried a quick reproduce and was confused by how you're using this tuple type. The end result is a javascript array which is used as an object instead? I can't find an example of typescript tuples that works like this, and I couldn't get your code to compile as is. The closest I got is below. At any rate, the reason for the serialization skipping that data is that it's relatively simple logic and just plucks the elements out of an array (no searching for specially added properties).
export class Connection {
id: string;
name: string;
groups?: IConnectionGroup[];
}
export interface IConnectionGroup {
0: string;
1: IConnectionAttribute;
}
export interface IConnectionAttribute {
displayName: string;
value: string;
path: string;
}
// ...
export class TestComponent {
connection: Connection = new Connection();
constructor() {
this.connection.groups = [['TestMock', {
displayName: 'MockName',
value: 'Mock Value',
path: 'Mock path',
}]];
}
}
Hi @stevenkampen thanks for looking into this. Unfortunately, it's not working for me with the latest version. I'll post a full sample soon so you can reproduce it easily.
Thank you, have a great weekend!
@sballarati I understand. My previous comment articulates why it won't work, and also asks how/why you're using tuples like this, and if our logic should be expected to serialize it properly.
@sballarati @stevenkampen It does work you just have to assign elements properly. Changing the above code as below works fine as Connection -> Group Array -> Attribute Array.
this.connection.groups = [['hello', [{
displayName: 'MockName',
value: 'Mock Value',
path: 'Mock path',
}]]];

Closing as above.