export class UsersList {
public currentUsers = [];
zone: NgZone;
constructor(@Inject(UsersService) private UsersService) {
this.zone = new NgZone({enableLongStackTrace: false});
UsersService.users.subscribe(newUsers => {
this.zone.run(()=> {
this.currentUsers = newUsers;
});
});
UsersService.fetchUsers();
}
}
this.zone = new NgZone({enableLongStackTrace: false});
for (var authorKey in book) {
console.log(book[authorKey].name);
}