Не удается прочитать свойство 'setProperty' с неопределенной проблемой fxFlex с контейнером ng Angular 9 Flex Layout - PullRequest
0 голосов
/ 30 апреля 2020
<div [fxLayout]="fields.layoutConfig.layoutDirection + ' wrap'" fxLayout.xs="column"
    [fxLayoutGap]="fields.layoutConfig.fxLayoutGap">

    <ng-container [fxFlex]="50" *ngFor="let field of fields.componentConfig;" reactiveField [field]="field" [group]="form">
    </ng-container>

</div>

Попытка использовать [fxFlex] = "50" внутри контейнера, получая ошибку Cannot read property 'setProperty' of undefined

enter image description here

Некоторые из выпуски https://github.com/angular/flex-layout/issues/1046 https://github.com/angular/flex-layout/issues/381

Ответы [ 2 ]

0 голосов
/ 01 мая 2020

Привязать контейнер внутри

<div [fxLayout]="fields.layoutConfig.fxLayout + ' wrap'" fxLayout.xs="column"
    [fxLayoutGap]="fields.layoutConfig.fxLayoutGap"
    [fxLayoutAlign]="fields.layoutConfig.fxLayoutAlignHorizontal + ' ' + fields.layoutConfig.fxLayoutAlignVertical">
    <div [fxFlex]="fields.layoutConfig.fxFlex" *ngFor="let field of fields.componentConfig;">
        <ng-container reactiveField [field]="field" [group]="form"></ng-container>
    </div>
</div>
0 голосов
/ 30 апреля 2020

Вы не должны использовать привязку свойств для fxLayout и fxLayoutGap.

...