Search code examples
angularjsangularangularjs-material

Angular material Layout Directives not working


I am trying to use the Child-Alignment feature of Angular Material. Mentioned Here: https://material.angularjs.org/latest/layout/alignment

This does not seem to work. I have tried importing
import { LayoutModule } from '@angular/cdk/layout'; I also tried installing
import { FlexLayoutModule } from '@angular/flex-layout';

None of them is working.


Solution

  • As @SiddAjmera commented you are using an AngularJS directive in Angular 6. I couldn't find anything similar from Angular 2+.

    If you're trying to align components in your view I really recommend you look into the display: flex css property. Here's a good explanation on how to use it.