Could you shed some light on why this code snippet is producing an error? It seems like splitval should be functioning correctly as a method. I've set up a stackblitz with the code here- don't forget to check the console for errors
Here's where the function is called:
[(this.filcol, this.strtrans)] = (d.trans as Transform).splitval();
The output shows:
edit trans:{"val":"fil.SalesOrderNo=.slice(0,7)","note":""} TypeError: d.trans.splitval is not a function
Defined within the class:
export class Transform {
val: string;
note: string;
splitval(): [string, string] {
try {
let filcol = this.val.substr(0, this.val.indexOf("="));
let strtrans = this.val.substr(this.val.indexOf("=") + 1);
return [filcol, strtrans];
} catch (e) {
console.log("err shared model splitval:" + e);
}
}
}