fxFlex角形Flex布局无法按预期的版本7.0.0-beta.19工作

时间:2018-12-13 11:04:16

标签: angular angular-material angular7 angular-flex-layout

Todo:

这是我的代码以及我尝试的操作:

<div fxLayout="row wrap" fxLayoutGap="32px" fxLayoutAlign="start start">
  <ng-container *ngFor="let _ of [1,2,3,4,5,6]">
    <p fxFlex="0 1 calc(33.3% - 32px)">Flex</p>
  </ng-container>
</div>

文档未在api中提供重大更改。
有人知道这里出了什么问题吗?
还是应该在github上发布问题?

1 个答案:

答案 0 :(得分:1)

您忘记在app.module.ts中导入FlexLayoutModule

import { FlexLayoutModule } from '@angular/flex-layout';
import { AppComponent } from './app.component';
import { HelloComponent } from './hello.component';

@NgModule({
  imports:      [ BrowserModule, FormsModule, FlexLayoutModule ],
  declarations: [ AppComponent, HelloComponent ],
  bootstrap:    [ AppComponent ]
})
export class AppModule { }
相关问题