大型嵌套 JSON DICT SignalR 字典到 Typescript

Large Nested JSON DICT SignalR dictonairy to Typescript

我是 angular/Typescript 的新手,为了学习打字稿,我遵循了

Class Data: 
DictKey = DictKey

// multiple use of the key value of the dict...
DictKey = Key 

Class Key: 

key1 = key1

key2 = key2

消息如下,多了很多dictkeys:

{"DATA1DICT1":{
    "Dictkey1": {
        "Key1": 1,
        "Key2": 1,
        "Key3": {
            "Key3.1": 1,
            "Key3.2": 1
        },
        "Key4": 1,
        "Key5": "2020-05-18"
    },
    "DictKey2": {
        "Key1": 1,
        "Key2": 1,
        "Key3": {
            "Key3.1": 1,
            "key3.2": 1
        },
        "Key4": 1,
        "key5": "2020-05-18"
    }
},
"DATA1DICT2":{
    "AnotherKey": 1,
    "AnotherKey": 1,
    "AnotherKey": 1,
    "KeyDict3": {
        "Key3.1": 1,
        "Key3.2": 1
    },
    "KeyDict4": {
        "Key4.1": 1,
        "Key4.2": 1
    }
}
}

上面的消息是一条消息,上面定义的键 value/dynamic 结构作为结果

不那么存在: 只是 json(解析) 并像在 c#

中一样构建嵌套对象