下面是具有根据我的业务需求更改行,列的逻辑的代码。当我保留这段代码时,在我的Angular2 ts代码中,我得到的提供参数与.forEach中的任何调用目标错误签名都不匹配(...
<div id="content"></div>
答案 0 :(得分:1)
As others mentioned in order to use self executing function with parameters you need to provide those parameters.
let myCol; // or you can set this to an initial value
let myRow;
data.forEach(function (col, row) {
return function (o) {
// your logic here
};
}(myCol, myRow));
Your typescript compiler is complaining because your function takes two parameters col
and row
but you are invoking it without any parameter.