Am creat o clasă în unghiulară, acum, când am preluat un obiect prin abonament magazin, deși returnează o matrice de obiect, dar nu pot folosi bucla foreach pe obiectul returnat.
Da, am folosit Object.keys (utilizator) .forEach () {..} Acesta este de lucru, dar vreau să fac același lucru prin a face clasa Iterable. Cum acest lucru.
Cod simplu:-
class user {
...
}
ngOnInit(){
storeSubsc = this.store.select('users').subscribe(user => {
this.user = user;
});
}
login(){
Object.keys(this.user).forEach()... --> working fine
I want it like
this.user.forEach() {... }
}
Mulțumesc anticipat...













