创建json转换器服务文件时出现angular6错误

时间:2018-11-01 08:55:02

标签: angular6

export class SuggestionConverterService extends JsonConverterService {

    constructor () {
        super();
    }

  // Logic to convert json to Object and use the classes that are created for ResultSet
jsonToObject (input: any) {

    input = JSON.parse(input);
    let resultItems: QuerySuggestion;
    let querySuggestionItems : QuerySuggestionItems[];
    //Assigining to ResultItem Class
    resultItems = input.resultItems.map((resultItem) => { 

    if(resultItem.suggestionItems != undefined)
    {
    querySuggestionItems = resultItem.suggestionItems.map(suggestionItem => new QuerySuggestionItems(suggestionItem.itemName, suggestionItem.score));
    }

    return new QuerySuggestion(input.query, querySuggestionItems)
    });

    return resultItems;
    } 


}

错误无法读取地图属性

0 个答案:

没有答案