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.

example/main.dart

library mediaquery.example;

import 'package:angular2/bootstrap.dart';
import 'package:angular2/angular2.dart' show Component, NgIf;
import 'package:ng_mediaquery/ng_mediaquery.dart';

@Component(
    selector: 'app',
    directives: const [MediaQuery, NgIf],
    template: '''
      <h1>Media Query is awesome</h1>

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

      <h1 *ngIf="isSmallDevice">This is a Small Device</h1>
      <h1 *ngIf="!isSmallDevice">This is a Large device</h1>
  ''')
class AppComponent {
  bool isSmallDevice = false;
}

main() => bootstrap(AppComponent, []);
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