大型嵌套JSON DICT SignalR文字转换为打字稿

问题描述 投票:0回答:1

我是angular / Typescript的新手,要学习我遵循的Typescript,>

Class Data: 
DictKey = DictKey

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

Class Key: 

key1 = key1

key2 = key2

该消息如下,带有更多的字典键:

{"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
    }
}
}

以上消息是具有以上定义的键值/动态结构的一条消息

我是angular / Typescript的新手,要学习打字稿,我遵循了班级数据:DictKey = DictKey //多次使用字典的键值... DictKey =班级键:key1 = key1 key2 = ...

json angular typescript signalr keyvaluepair
1个回答
0
投票

尚不存在:只是json(parse)并像在c#中那样构建嵌套对象

© www.soinside.com 2019 - 2024. All rights reserved.