UNPKG

ionic-angular

Version:

A powerful framework for building mobile and progressive web apps with JavaScript and Angular 2

104 lines (103 loc) 3.13 kB
import { NgZone } from '@angular/core'; import { Platform } from '../../platform/platform'; /** * @private */ export declare class DisplayWhen { _plt: Platform; zone: NgZone; isMatch: boolean; conditions: string[]; resizeObs: any; constructor(conditions: string, _plt: Platform, zone: NgZone); orientation(): boolean; ngOnDestroy(): void; } /** * * @name ShowWhen * @description * The `showWhen` attribute takes a string that represents a platform or screen orientation. * The element the attribute is added to will only be shown when that platform or screen orientation is active. * * Complements the [hideWhen attribute](../HideWhen). If the `showWhen` attribute is used on an * element that also has the `hideWhen` attribute, the element will not show if `hideWhen` evaluates * to `true` or `showWhen` evaluates to `false`. If the `hidden` attribute is also added, the element * will not show if `hidden` evaluates to `true`. * * View the [Platform API docs](../../../platform/Platform) for more information on the different * platforms you can use. * * @usage * ```html * <div showWhen="android"> * I am visible on Android! * </div> * * <div showWhen="ios"> * I am visible on iOS! * </div> * * <div showWhen="android,ios"> * I am visible on Android and iOS! * </div> * * <div showWhen="portrait"> * I am visible on Portrait! * </div> * * <div showWhen="landscape"> * I am visible on Landscape! * </div> * ``` * @demo /docs/v2/demos/src/show-when/ * @see {@link ../HideWhen HideWhen API Docs} * @see {@link ../../../platform/Platform Platform API Docs} */ export declare class ShowWhen extends DisplayWhen { constructor(showWhen: string, plt: Platform, zone: NgZone); } /** * @name HideWhen * @description * The `hideWhen` attribute takes a string that represents a plaform or screen orientation. * The element the attribute is added to will only be hidden when that platform or screen orientation is active. * * Complements the [showWhen attribute](../ShowWhen). If the `hideWhen` attribute is used on an * element that also has the `showWhen` attribute, the element will not show if `hideWhen` evaluates * to `true` or `showWhen` evaluates to `false`. If the `hidden` attribute is also added, the element * will not show if `hidden` evaluates to `true`. * * View the [Platform API docs](../../../platform/Platform) for more information on the different * platforms you can use. * * @usage * ```html * <div hideWhen="android"> * I am hidden on Android! * </div> * * <div hideWhen="ios"> * I am hidden on iOS! * </div> * * <div hideWhen="android,ios"> * I am hidden on Android and iOS! * </div> * * <div hideWhen="portrait"> * I am hidden on Portrait! * </div> * * <div hideWhen="landscape"> * I am hidden on Landscape! * </div> * ``` * * @demo /docs/v2/demos/src/hide-when/ * @see {@link ../ShowWhen ShowWhen API Docs} * @see {@link ../../../platform/Platform Platform API Docs} */ export declare class HideWhen extends DisplayWhen { constructor(hideWhen: string, plt: Platform, zone: NgZone); }