ionic3 - 我想将 WordPress 网站上的广告集成到我的 ionic 应用程序中,我该怎么做?
问题描述
我正在使用 WordPress API 构建一个离子应用程序,但我不知道如何在我的应用程序上显示广告
这是我的 html 文件。
<ion-content>
<div class="item-profile" text-center #profilePic [style.background-
image]="'url(' + item?.jetpack_featured_media_url + ')'">
</div>
<div class="item-detail" padding style=" z-index: 1119">
<h1 [innerHTML]="item?.title.rendered"></h1>
<h6>{{item?.date}}</h6>
</div>
<div class="item-detail" padding>
<span [innerHTML]="item?.content.rendered"></span>
</div>
</ion-content>
这是 .ts 文件
export class ItemDetailPage {
item: any;
getData:any;
constructor(public navCtrl: NavController,public api:Api,
navParams: NavParams, items: Items,public http: HttpClient) {
var temp = navParams.get('itemName') || items.defaultItem;
console.log(temp)
this.getPOst(temp.id)
}
getPOst(id){
this.api.get1('wp-json/wp/v2/posts/' + id).subscribe(data=>{
console.log(data)
this.item = data
})
}
解决方案
推荐阅读
- electron - 如何隐藏 Electron.js 菜单栏
- makefile - 带有多个命令的 Makefile
- python - 如何在for循环中一次从2个不同的数据帧中读取行?
- javascript - Event.target 在 React 类型按钮中返回 undefined
- c# - xamarin 形式:如何获得蓝牙 LE 通知
- python - Django ImportError:没有名为 myapp_name.settings 的模块
- r - 将数据框字符列拆分为R中具有动态列名的任意数量的列
- scala - Akka 中 Ask 的默认超时时间是多少?
- mysql - 当主键不连续时计算两行之间的时间差。如何?
- android - 使用 Instagram 分享时“找不到图片”