我想制作一个Map
,其中每个成员包含一个字符串array.但是我如何初始化和输入它(在一条语句中)?
(天真地)我试过:
private _gridOptions:Map<string, Array<string>> = {"1": ["test"]};
我得到:
Module build failed: Error: /Users/*****/Work/dashboard/src/app/core/pg.service.ts (8,5): Type '{ "1": string[]; }' is not assignable to type 'Map<string, string[]>'.