首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在更新*ngIf条件时修复此wijmo弹出窗口的行为

如何在更新*ngIf条件时修复此wijmo弹出窗口的行为
EN

Stack Overflow用户
提问于 2019-06-03 21:24:32
回答 1查看 226关注 0票数 0

我有wijmo弹出窗口,里面有一些内容,有一个带有*ngIf条件的ng-container,如果计算为true,则显示X,否则显示ng-template。问题是,如果我更新ng-container中的条件以显示else语句,这会导致关闭wijmo弹出窗口(else语句在关闭之前很快就会显示)。

如果我在ng容器之外(仍然在wijmo弹出窗口中)更新条件,那么行为是正确的。我在wijmo弹出窗口外尝试了相同的代码,行为是正确的。

代码语言:javascript
复制
<wj-popup id="wj_popup_1 [modal]="true">
   <ng-container *ngIf="!estListeTropLongue; else messageListeTropLong">
      <button (click)="estListeTropLongue = true"></button>
   </ng-container>
   <ng-template #messageListeTropLong>
      <div class="message-liste-trop-long">Veuillez saisir des caractères pour 
      lancer la recherche</div>
   </ng-template>
</wj-popup>

wijmo弹出窗口不应该关闭并显示ng-template信息,但是弹出窗口关闭时没有任何控制台错误。

谢谢

EN

回答 1

Stack Overflow用户

发布于 2019-06-05 03:17:18

你可以将wijmo弹出窗口的隐藏触发器设置为'None';

代码语言:javascript
复制
<wj-popup id="wj_popup_1 [modal]="true" [hideTrigger]="None">
   <ng-container *ngIf="!estListeTropLongue; else messageListeTropLong">
      <button (click)="estListeTropLongue = true"></button>
   </ng-container>
   <ng-template #messageListeTropLong>
      <div class="message-liste-trop-long">Veuillez saisir des caractères pour 
      lancer la recherche</div>
   </ng-template>
</wj-popup>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56428337

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档