zoukankan      html  css  js  c++  java
  • angular模板中使用动态html

    <farris-button id="openReport" class="d-none" (click)="farrisDialog.show()">Open Dialog</farris-button>
    <ng-template #buttonRef>
        <farris-button  (click)="farrisDialog.close()">确定</farris-button>
    </ng-template>
    <farris-dialog #farrisDialog [title]="geagag" [buttons]="buttonRef" [width]="640" [height]="480">
        <ng-container *ngFor="let item of viewModel.report">
            <div class="pl-4" >
                <pre>{{item.ledgerName}}</pre>
                <div class="pl-4">{{item.content}}</div>
            </div>
        </ng-container>
    </farris-dialog>

    现在想插值{{item.content}}中放动态拼接的html 则

    <farris-button id="openReport" class="d-none" (click)="farrisDialog.show()">Open Dialog</farris-button>
    <ng-template #buttonRef>
        <farris-button  (click)="farrisDialog.close()">确定</farris-button>
    </ng-template>
    <farris-dialog #farrisDialog [title]="geagag" [buttons]="buttonRef" [width]="640" [height]="480">
        <ng-container *ngFor="let item of viewModel.report">
            <div class="pl-4" >
                <pre>{{item.ledgerName}}</pre>
                <div class="pl-4" [innerHTML]="item.content"></div>
            </div>
        </ng-container>
    </farris-dialog>
  • 相关阅读:
    swift3.0 运行时获取类的属性
    Runloop与autoreleasePool联系
    iOS 加载Image的两种方式
    iOS strong与weak的使用
    iOS 自定义layer的两种方式
    iOS 手势识别
    iOS Quartz2D画图
    iOS 通知的使用
    UITableViewController
    UITableView移动
  • 原文地址:https://www.cnblogs.com/wolbo/p/13545570.html
Copyright © 2011-2022 走看看