angular cdk media query
import { Component, OnInit } from '@angular/core';
import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';
@Component({ ... })
export class AppComponent implements OnInit {
public showContainer: boolean;
constructor(public breakpointObserver: BreakpointObserver) {}
ngOnInit() {
this.breakpointObserver
.observe(['(min-width: 400px)'])
.subscribe((state: BreakpointState) => {
if (state.matches) {
this.showContainer = true;
} else {
this.showContainer = false;
}
});
}
}
Also in JavaScript:
- initialize express app
- jquery element width
- insert element to dom
- ip my adress
- javascript algorithms
- decimal to base 32 javascript
- redux saga fetch data using axios
- how to get a bot online on discord
- prevent form submission using jquery
- javascript open url
- merge 2 arrays jquery
- Cannot find module '@angular/cdk/a11y'
- javascript snumber two decimal places as string
- browser detect javascript
- jquery basic authenticated get user
- .join in javascript
- devexpress winforms get readonly colour for current themes
- === in js
- javascript animate elements
- checkbox is checked jquery
- promise catch
- js try..catch works synchronously.
- how to compare previous value with current in javascript
- how remove child in jquery