Answer the question
In order to leave comments, you need to log in
How to solve Map and async/await "No overload matches this call" problem?
There is a function that returns certain content,
public async getContent() {
const a = new Map([
[
'AA',
new Map([
['desc', [await this.i18n.t('Hello'), await this.i18n.t('Hello')]],
])
]
]);
public async getContent() {
const a = new Map([
[
'AA',
new Map([
['desc', [await this.i18n.t('Hello'), await this.i18n.t('Hello')]],
['a', 'b']
])
]
]);
Answer the question
In order to leave comments, you need to log in
Specify Explicitly a Generic for the Internal Map
public async getContent() {
const a = new Map([
[
'AA',
new Map<string, string | string[]>([
['desc', [await this.i18n.t('Hello'), await this.i18n.t('Hello')]],
['a', 'b']
])
]
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question