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;
}
}
错误无法读取地图属性