使用泛型编译datatable
时遇到错误
"TypeError: pMap.get is not a function"
代码:
import { has,HashMap, map } from '@typed/hashmap';
import { element, promise } from 'protractor';
var pMap = new Map();
export class ParamManager {
//async dt(dataTable ):Promise<ElementFinder> {
dt(datatable ) {
//let result = new Map();
//var pMap = new Map();
var result=datatable.rowsHash();
//for (Map<String, String> data : arg1.asMaps(String.class, String.class)) {
// result.map((item) => {
// pMap=item
let tempArray=[];
tempArray.push(result);
tempArray.forEach(element=>{
//element.get().toString().trim();
pMap=element;
} );
// result.array.forEach(element => {
// element.get(0).toString().trim();
console.log(pMap)
}
public getParam( key:any) :Promise<any>{
return pMap.get(key);
}
}
答案 0 :(得分:0)
import { has,HashMap, Map } from '@typed/hashmap';
在您的imp0rt语句中确保有关地图。应该是地图