【发布时间】:2020-02-17 04:29:45
【问题描述】:
我必须在每次点击时选择 drop 更改内容如何在 html 和 angular 中的多个条件中使用 *ngIf "
我已经尝试过但没有工作
//HTML
<div>
{{服务}}
<div *ngIf ="service === 'Consult'">
<p>Loren Gypsum is simply dummy text of the printing and typesetting industry. has been the industry's
standard dummy text ever since the when an unknown printer took a galley of type and scrambled it to make
a type specimen book.</p>
</div>
<div *ngIf= "service === 'Data' ">
<p>Loren Gypsum is simply dummy text of the printing and typesetting industry. has been the industry's
standard dummy text ever since the 1500, when an unknown printer took a galley of type and scrambled</p>
</div>
<div *ngIf="Digital">
<p>Loren Gypsum is simply dummy text of the printing and typesetting industry. has been the industry's
standard dummy text ever since the 1500,</p>
</div>
<div *ngIf="Security">
<p>Loren gypsum is simply dummy text of the printing and typesetting industry.has been the industry's standard dummy text ever since the 1500, when an unknown printer took a galley of</p>
</div>
<div *ngIf="Cloud">
<p>Loren gypsum is simply dummy text of the printing and typesetting industry.has been the industry's
</p>
</div>
//Ts
services = ['Consult', 'Data', 'Digital', ' Security', 'Cloud']
}
【问题讨论】:
-
你想做什么?
services这里是数组,你是用字符串比较吗? -
我需要解决方案,因为我在每次点击时都使用选择下拉菜单来更改每次点击内容
标签: javascript html angular