1//listen for window resize event
2window.addEventListener('resize', function(event){
3 var newWidth = window.innerWidth;
4 var newHeight = window.innerHeight;
5});
1 window.onresize = () => {
2 this.setState({ ww: window.innerWidth }); this.build(); this.draw();
3 }
1resizeObservable$: Observable<Event>
2resizeSubscription$: Subscription
3
4ngOnInit() {
5 this.resizeObservable$ = fromEvent(window, 'resize')
6 this.resizeSubscription$ = this.resizeObservable$.subscribe( evt => {
7 console.log('event: ', evt)
8 })
9}