To avoid this error without turning off SSR, I use a code like this,
ngOnInit(): void {
if (typeof window !== 'undefined' && localStorage) {
this.adminId = localStorage.getItem('admin_id') || '';
this.loadAdminDetails(this.adminId);
}}
And I would also like to know whether this method has any issue. Thanks in advance.