-
-
Save analisboeta/511130bafe50a435aeb0d1dcec8467b5 to your computer and use it in GitHub Desktop.
Detect screen size Angular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {BreakpointObserver} from '@angular/cdk/layout'; | |
... | |
breakpointObserver.observe(['(max-width: 1024px)']).subscribe(result => { | |
if (result.matches) { | |
this.responsiveVersion = true; | |
} else { | |
this.responsiveVersion = false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment