【发布时间】:2017-12-26 00:14:56
【问题描述】:
我在 Typescript 中有一个包含地图的类:
public map:Map<string,string>;
constructor() {
let jsonString = {
"peureo" : "dsdlsdksd"
};
this.map = jsonString;
}
问题是初始化不起作用。
jsonString 是我将从序列化为 Json 的 Java 对象接收到的东西。
有人可以帮忙吗?谢谢!
【问题讨论】:
-
@MarkRotteveel 我假设是因为该对象是在 Java 应用程序中序列化的。 “ jsonString 是我将从序列化为 Json 的 Java 对象中收到的东西” 但你说得对,这是一个不敬的细节。
标签: javascript json typescript initialization