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 used to index type Object.
error 2:
Element implicitly has an ‘any’ type because expression of type ‘”$key”‘ can’t be used to index type ‘Object’.
let clsss: Object
I tried to use : string, type of string, key of string, as string but these solutions did not work.
1