简体   繁体   English

ionic 4 - 有没有办法在 3 个项目之后的离子列表之间实施谷歌广告?

[英]ionic 4 - is there any way to implement google ads in between ion list after 3 items?

i want to implement google banner ad after 3 items in ion list i have tried a different methods, but my problem isn't solved.can anyone help me out to solve the problem?我想在离子列表中的 3 个项目之后实施谷歌横幅广告我尝试了不同的方法,但我的问题没有解决。谁能帮我解决这个问题?

Here's what I'd like to attempt:这是我想尝试的:

` `

 <div *ngFor="let n of news;let i=index;"> <ion-card class="myCard" *ngIf="news.typ === 'N'"> <h3> <b>{{n.title}}</b> </h3> </ion-card> <div *ngIf="(i+1)%3 ===0"> <!-- INSERT AD AFTER THE3rd ITEM --> </div> </div>

your using {{news.title}} but news is a complete array, you have to use n.title您使用 {{news.title}} 但新闻是一个完整的数组,您必须使用 n.title

<div *ngFor="let n of news;let i=index;">
<ion-card class="myCard" *ngIf="n.typ === 'N'">
  <h3>
    <b>{{n.title}}</b>
  </h3>
</ion-card>
<div *ngIf="(i+1)%3 ===0">
  <!-- INSERT AD AFTER THE3rd ITEM -->
  <b>Advertisement</b>
</div>

Happy coding:-)快乐编码:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM