Angular NgReflectProperty的设置位置 - 只有在调试模式下才设置该属性

81 阅读1分钟

这四根border是的outline,只有当屏幕不够宽时才能完全显现:

当屏幕足够宽时,a的outline轮廓线只有最左边visible了:

仅当移除width: 100%和min-height: 74px时,所有border重新显现。

例子:

      <td *ngFor="let cell of structure.cells; let i = index" [class]="cell">
        <ng-template
          [cxOutlet]="getDataOutletRef(cell)"
          [cxOutletContext]="getDataOutletContext(cell, item)"
        >
          {{ item[cell] }}
        </ng-template>
      </td>

ng-template的cxOutlet和cxOutletContext绑定:

调用ɵɵproperty:

只有在devMode下才设置NgReflectProperties:


这个value就是待设置的值:

页面上的unit数据:

正好是value变量children属性里显示的内容:

这个函数里准备创建#comment节点写入调试目的的NgReflectProperty值:

最后写入#comment节点的内容:

更多Jerry的原创文章,尽在:“汪子熙”: