Relative Content

Tag Archive for angulartypescriptfor-loopindexing

Type ‘string’ can’t be used to index type ‘Object’ with for loop

getAllstudents(stdnt: string){ let clsss=new Object(); this.clssservice.getclsss(stdnt) .subscribe( stndt =>{ for(let key in stndt ){ clsss=stdnt[key]; clsss[‘$key’]=key; error 1: Element implicitly has an ‘any’ type because expression of type ‘string’ can’t be used to index type ‘Object’. No index signature with a parameter of type ‘string’ was found on type ‘Object’.ts (parameter) stndt string can’t be […]

Type ‘string’ can’t be used to index type ‘Object’

getAllstudents(stdnt: string){ let clsss=new Object(); this.clssservice.getclsss(stdnt) .subscribe( stndt =>{ for(let key in stndt ){ clsss=stdnt[key]; clsss[‘$key’]=key; error 1: Element implicitly has an ‘any’ type because expression of type ‘string’ can’t be used to index type ‘Object’. No index signature with a parameter of type ‘string’ was found on type ‘Object’.ts(7053) (parameter) stndt string can’t be […]