Saturday, January 4, 2020

How to install flex layout in angular

Angular Flex Layout provides a sophisticated layout API using Flexbox CSS + mediaQuery. This module provides Angular developers with component layout features using a custom Layout API, mediaQuery observables, and injected DOM flexbox-2016 CSS stylings.
How to install flex layout in angular

The Flex Layout engine intelligently automates the process of applying appropriate Flexbox CSS to browser view hierarchies. This automation also addresses many of the complexities and workarounds encountered with the traditional, manual, CSS-only application of box CSS.

The real power of Flex Layout, however, is its responsive engine. The Responsive API enables developers to easily specify different layouts, sizing, visibilities for different viewport sizes and display devices.
Step 1. install libary fex layout
npm i -s @angular/flex-layout @angular/cdk
Step 2. Next, you'll need to import the Layout module in your app's module.
quang cao trong bai viet bolg codeandroid
app.module.ts
import { FlexLayoutModule } from '@angular/flex-layout';
@NgModule({
    imports: [ FlexLayoutModule ],
});
Step 3.After that is configured, you can use the Angular Layout attributes in your HTML tags for flex layout
<div fxLayout="row" fxLayoutAlign="space-between">
</div>