I am having the following code in typescript :
export class Custom {
[k: string]: any // Index Signature
// parameters example
// let o:Object = {"blah":1, "foo": "lol"}
// let arr: Array<string> = ["blah", "foo"]
constructor(o: Object, p: Array<string>)
for(let prop of arr) {
let p: any = (<any>o)[prop]
if (p !== undefined) {
this[prop] = p
}
}
}
I keep having TS7017 Index signature of object type implicitly has an 'any' type
on this[prop] = p
Thanks !
Edit : Adding the index signature solved my problem.