我目前在一个项目中工作,这需要我填充一个动态数量的按钮与浸泡的链接,以打开它们。 <tr *ngFor="let competence of competences; let i = index">{{competence.name.de}}
<td *ngFor="let competenceLevel of levels; let j = index">
<button type="button" *ngFor="let learnRecommendation of getLearnReco
Stackblitz Demo of my app 在我的应用程序中,我尝试循环遍历地图(使用*ngFor),并在新的扩展面板中显示每个地图键,并在扩展面板的“主体”中显示这些值: ? 映射以字符串作为键,字符串数组作为值。填充地图后,我将其传递到this.showMap中。这样做的唯一原因是,在向用户显示网站之前,我可以等待带有*ngIf="showMap"的showMap,以确保所有项目都在地图中: showMap: any;
ngOnInit() {
let myMap: Map<string, string[]> = new Ma
我正在尝试创建一个带有角2的应用程序;我希望当最后一个元素在*ngFor中呈现时,执行一个函数,如下所示,标记是<img>:
<img *ngFor="let image of template.previewImages; let i = index" [src]="image" [class.hs_visible]="i==0" />
函数名是
animation(){console.log('enter');}
我有这个跨度
<span *ngFor="let list of lists[0].question; let i = index" id="word{{ i }}" (click)="changestyle($event)" class="highlight">
{{ list}}
</span>
当我尝试用类高亮显示所有元素时
check() {
let highlight_text= $('.highlight');
console.log(highlight_t
当我在回调中更改对底层数组的引用时,无法立即获得要刷新的ngFor列表。该回调由数据库调用。
在我的模板中,我有以下内容:
<ion-item *ngFor="let todo of todos">
// Other items here
</ion-item>
在我的课堂上,我有这样的想法:
Database.addChangeListener(newArray => {
// This callback gets called, but the UI does not get refreshed.
// I can see that
我有一个对象数组(config.lensTab),我在ngFor中显示了这个数组:
<tr *ngFor="let item of config.lensTab; let i = index;">
<th scope="row">{{ i + 1}}</th>
<th><label></label>
<input [(ngModel)]="item.radius" class="form-control