fxHide API (original) (raw)

The fxHide directive allows developers to dynamically and/or responsively show/hide the hosting element. The fxHide logic defaults to hiding an element.

API

  1. ngx-ayout supports STATIC API for responsive layouts using the API without .<xxx> alias suffixes: fxShow, fxHide, etc. These values of these directives are used (and styles applied) regardless of the viewport size. These static rules can be specifically overridden by a registered responsive API use (see below).
  2. ngx-layout provides a RESPONSIVE API for dynamic adaptive layouts. This is simply using the the static API with mediaQuery alias suffixes. e.g.

Using fxShow & fxHide

Using Responsive API

When a mediaQuery range activates, the directive instances will be notified. If the current activated mediaQuery range (and its associated alias) are not used, then the static API value is restored as the fallback value.

The fallback solution uses a largest_range-to-smallest_range search algorithm. Consider the following:

Please note that there is no left-to-right precedence. This is an incorrect interpretation..

Combine Uses of fxShow + fxHide

We can leverage the default values of these directives select specific conditions when an element is hidden or shown.

Consider:

means the the above element will be hidden by default and ONLY shown on viewport sizes greater than mobile.

means the the above element will be shown by default and ONLY hidden on viewport sizes == md mediaQuery ranges.