ng_mediaquery 0.1.3 copy "ng_mediaquery: ^0.1.3" to clipboard
ng_mediaquery: ^0.1.3 copied to clipboard

Dart 1 only

A Angular 2 directive that can be used to data bind to a CSS media query.

ng_mediaquery #

Inspired by iron-media-query

A angular 2 directive that can be used to data bind to a CSS media query.

How to use #

The query property is a CSS media query, learn more about them here. The matches property is a boolean representing whether the page matches that media query.

<media-query query="(max-width : 768px)" [(matches)]="isSmallDevice"></media-query>

<div *ngIf="isSmallDevice">
   Some awesome content for small devices
</div>

isSmallDevice must be a property in your controller. When running on Dartium *ngIf may complain if isSmallDevice is null, you can solve that but setting a non-null value to it, it will be updated as soon as media-query gets its first result.

0
likes
35
points
3
downloads

Publisher

unverified uploader

Weekly Downloads

A Angular 2 directive that can be used to data bind to a CSS media query.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

angular2

More

Packages that depend on ng_mediaquery