This is code which works with angularjs material.
<div flex="50" flex-sm="100">
Some data
</div>
How can I implement it in my Angular material 2 app?
Follow these steps to get it working:
Install the flex-layout
dependency:
npm install @angular/flex-layout
Import the FlexLayoutModule
to your AppModule
:
import { FlexLayoutModule } from '@angular/flex-layout';
import { NgModule } from '@angular/core';
@NgModule({
imports: [
FlexLayoutModule,
// Other modules
]
})
export class AppModule {}
Change your code to the following:
<div fxFlex="50%" fxFlex.sm="100%">
Some data
</div>