There seems to be an issue here, as the code is not being triggered at all. The console log is not printing and this.width is not changing.
constructor(private host: ElementRef, private zone: NgZone) {}
public ngOnInit(): void {
this.observer = new ResizeObserver(entries => {
this.zone.run(() => {
this.width$.next(entries[0].contentRect.width);
console.log('width', width);
});
});
this.observer.observe(this.host.nativeElement);
}