[英]Ionic Data Parse using JSON API Issue
我正在嘗試通過在wordWord的ionWordpress(離子框架插件)中使用JSON來獲取數據。
我正在使用JSON API。 這是我的JSON中的數據。
{
"status": "ok",
"count": 6,
"count_total": 45,
"pages": 8,
"posts": [
{
"id": 1874,
"type": "event",
"slug": "stesets",
"url": "http://www.web.com/page",
"status": "publish",
"title": "setst",
"title_plain": "tests",
"content": "testsetstst",
"excerpt": "testsetststtes",
"date": "2017-11-27 17:20:17",
"modified": "2017-11-27 17:20:17",
"categories": [],
"tags": [],
"author": {
"id": 1,
"slug": "test",
"name": "test",
"first_name": "",
"last_name": "",
"nickname": "test",
"url": "",
"description": ""
},
"comments": [],
"attachments": [],
"comment_count": 0,
"comment_status": "closed",
"thumbnail": "http://www.website.com/wp-content/uploads/2017/11/image.jpg",
我的問題是,當我嘗試獲取數據時,它也包含[]。 例如。
{{post.thumbnail}}
這將顯示[“ http://www.website.com/wp-content/uploads/2017/11/image.jpg ”]
但我只想要鏈接本身不帶[“”]
我該怎么做呢?
我用了:
{{post.thumbnail[0]}}
如Diluk Angelo的評論中所述。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.