How to use the @angular/flex-layout.MediaChange function in @angular/flex-layout

To help you get started, we’ve selected a few @angular/flex-layout examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github outcobra / outstanding-cobra / frontend / src / app / core / mock / ui / mock-observable-media.service.ts View on Github external
import {MediaChange, ObservableMedia} from '@angular/flex-layout';
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {Subscription} from 'rxjs/Subscription';

@Injectable()
export class MockObservableMedia extends ObservableMedia {
    private observable: Observable = Observable.of(
        new MediaChange()
    );

    isActive(query: string): boolean {
        return false;
    }

    asObservable(): Observable {
        return this.observable;
    }

    subscribe(next?: (value: MediaChange) => void, error?: (error: any) => void, complete?: () => void): Subscription {
        return this.observable.subscribe(next, error, complete);
    }

}
github WISE-Community / WISE / src / main / webapp / site / src / app / app.component.spec.ts View on Github external
return Observable.create(observer => {
      observer.next(new MediaChange());
      observer.complete();
    });
  }