小编Raj*_*dam的帖子

两个Spring Boot应用程序之间的通信类型

我有2个Spring Boot应用程序,需要在这两个应用程序之间进行通信。我有休息模板可以交流。除了休息模板以外,还有其他交流技巧吗?

java rest http spring-boot

7
推荐指数
2
解决办法
3094
查看次数

<ng-template> </ ng-template>正在加载多次

我正在使用ngTemplateOutlet加载。但是它会多次加载模板。正在加载正确的模板,但会多次执行loadTemplate()方法。

HTML中

<table>
    <thead>
    </thead>
    <tbody>
        <ng-template [ngTemplateOutlet]="loadTemplate()"></ng-template>
    </tbody>
</table>

<ng-template #template1>
    <tr *ngFor="iteration">
        <p>Hiii</p>
    </tr>
</ng-template>

<ng-template #template2>
    <tr *ngFor="iteration">
        <p>Byee</p>
    </tr>
</ng-template>
Run Code Online (Sandbox Code Playgroud)

在我的component.ts中

@ViewChild('template1') template1: TemplateRef<any>;
@ViewChild('template1') template1: TemplateRef<any>;
loadTemplate(){
    if (condition)
        return this.template1;

    return this.template2;
}
Run Code Online (Sandbox Code Playgroud)

templates angular2-template ng-template angular angular5

4
推荐指数
1
解决办法
1252
查看次数