

Here is the result that you will get in the console. If you want to know exactly to which CSS media query each breakpoint corresponds to, you can simply print them out to the screen, as the breakpoints are just strings containing the text of the media query. TabletLandscape, HandsetPortrait and HandsetLandscape is all we need for most use cases. This is a complete list, but I find that most of the time TabletPortrait,
Responsive resize tool series#
The BreakpointObserver service comes with a series of pre-built CSS breakpoints, that identify different types of devices and screen form factors:Įach of these breakpoints corresponds to a CSS media query, carefully written and researched to accurately match a very broad range of devices.
Responsive resize tool code#
Using this service does not imply having to import a lot of code into your application, as the CDK is very modular. You can use it with Angular Material, but you can also use it without it. Notice that this service is part of the Angular Component Development Kit and not part of Angular Material directly. This service will also emit new values when we simulate different screen sizes using the dev tools, which is ideal for testing multiple layouts during development. This service provides us with an observable-based API that notifies its subscribers of the current dimensions of the screen, and any changes to the screen orientation caused by switching the device from landscape to portrait mode. The key to making our application responsive without writing our own media queries is the Angular CDK BreakpointObserver service. So without further ado, let's get started learning everything that we need to know for making your Angular application responsive! The BreakpointObserver Service

Responsive resize tool how to#
