Angular Layout comes built-in with several advanced capabilities that are meant to help developers seamlessly integrate Flexbox and CSS Grid utilities into their applications. However, there are times where these behaviors are not desirable, and so this library offers the ability to configure them. The specific configurable behaviors, and how to turn them off, are detailed below.
To configure Angular Layout, initialize the top-level module using the withConfig
method as follows:
import {FlexLayoutModule} from '@angular/flex-layout';
FlexLayoutModule.withConfig(configOptions, [breakpoints]);
The withConfig
method takes two arguments: a configuration object, and a list of custom breakpoints.
This is the same as providing the breakpoints following the Custom Breakpoints guide.
The Angular Layout module can be configured with the following options:
addFlexToParent
: whether to addflex-direction
stylings to the parent of anfxFlex
directive, if not presentaddOrientationBps
: whether to add the orientation breakpoints to the moduledisableDefaultBps
: whether to disable the default breakpoints from use in the moduledisableVendorPrefixes
: whether to disable the--webkit
prefix from applied stylingsserverLoaded
: whether to simulate the module being in server modeuseColumnBasisZero
: whether the defaultflex-basis
value should be1e-9px
(otherwiseauto
)
The breakpoints provided as the second argument can be either a singular BreakPoint
, or a BreakPoint
array