我有一个数组,我正在迭代ngFor,数组是:
Form_Array: any[] = ["Contact Details","PAN","Aadhaar","Basic
Details","Address","Regulatory Info","Segments",
"Document Upload", "Brokerage", "Review", "In-person verification"
];我收到了一些我在localStorage上设置的应用程序接口响应。
我想如果我得到了"AAdhar“从API的响应,那么上面的所有链接都应该能够点击包括”阿德哈尔“和休息下面的元素应该被禁用。
Here is the image of that grid
请建议我该怎么做?
以下是HTML模板:
<div class="border-5">
<div class="index-layout" *ngFor="let form_feild of Form_Array;let i=index" (click)="showForm(form_feild)">
<p class="font-type"><span class="padd_align" >{{i+1}}</span>{{form_feild}}</p></div>
</div>发布于 2018-10-08 13:15:43
您可以根据响应中的索引值启用或禁用网格内容的链接。实现将是
如果当前值的索引小于'aadharIndex‘,则
发布于 2018-10-08 13:31:36
首先,找到索引。
var in= Form_Array.indexOf("Aadhaar");然后,应用
<div class="border-5">
<div class="index-layout" *ngFor="let form_feild of Form_Array;let i=index" ng-disable="i>in" (click)="showForm(form_feild)">
<p class="font-type"><span class="padd_align" >{{i+1}}</span>{{form_feild}}</p></div>
</div>https://stackoverflow.com/questions/52695593
复制相似问题