Am using Angular 17 with SSR and have imported third party libraries which has been installed.
Am importing one component from these libraries into my app.component.html, but getting error window is not defined. It works if i turn off SSR.
How do I fix this?
app.component.ts
import { SideBarComponent, SidebarItemComponent } from '@impactech/sidenav';
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet, SideBarComponent, SidebarItemComponent],
templateUrl: './app.component.html',
styleUrl: './app.component.scss'
})
app.component.html
<router-outlet>
<impactech-sidebar>
<impactech-sidebar-item type="header" label="Header"></impactech-sidebar-item>
<impactech-sidebar-item label="item without icon" link="#"></impactech-sidebar-item>
<impactech-sidebar-item bottom label="item at bottom" link="#" icon="icons8-o-settings"></impactech-sidebar-item>
</impactech-sidebar>
<router-outlet/>