Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法读取属性';setProperty';使用ng容器角度9 Flex布局解决未定义的fxFlex问题_Javascript_Angular_Typescript_Angular Material_Angular Flex Layout - Fatal编程技术网

Javascript 无法读取属性';setProperty';使用ng容器角度9 Flex布局解决未定义的fxFlex问题

Javascript 无法读取属性';setProperty';使用ng容器角度9 Flex布局解决未定义的fxFlex问题,javascript,angular,typescript,angular-material,angular-flex-layout,Javascript,Angular,Typescript,Angular Material,Angular Flex Layout,试图在容器内使用[fxFlex]=“50”时出错无法读取未定义的属性“setProperty” 一些问题 您不应该对fxLayout和fxLayoutGap使用属性绑定 将容器绑定到 <div [fxLayout]="fields.layoutConfig.layoutDirection + ' wrap'" fxLayout.xs="column" [fxLayoutGap]="fields.layoutConfig.fxLayoutGap"> <ng-c

试图在容器内使用[fxFlex]=“50”时出错
无法读取未定义的属性“setProperty”

一些问题
您不应该对
fxLayout
fxLayoutGap
使用属性绑定

将容器绑定到

<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>

我必须使用属性绑定,因为fxLayout和fxLayoutGap是动态值,它们不是静态的,fxFlex也是动态值,但要问这个问题,我将其作为静态值引用-
<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>