[英]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.