I have created a class in angular, now when I fetch an object via store subscription, although it returns an array of object, but I cannot use forEach loop on the returned object.
Yes, I have used Object.keys(user).forEach(){..} It is working, but I want to do the same thing by making class Iterable. How To this.
Sample code:-
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() {... }
}
Thanks in Advance...