我不明白如何处理我订阅的对象。对象是以下结构:
{
data:{
date: "2018-02-20 13:10:23",
text: "????????",
id: 1,
items: [
0: {
date: "2018-02-20 13:10:23",
text: "????????",
images: [
0: "image1.jpg",
1: "image2.jpg"
],
name: "???????????",
type: "images"
},
1: {
date: "2018-02-20 13:10:23",
text: "????????",
image: null,
type: "video",
url: "https://www.youtube.com/embed/v64KOxKVLVg"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
我通过服务提出上诉:
import {HttpClient} from '@angular/common/http';
import {Injectable} from '@angular/core';
@Injectable()
export class VideoService {
constructor(private http: HttpClient) {}
getVideoTape() {
return this.http.get(`http://ip_adress/api/v1/mixed_galleries/1`);
}
}
Run Code Online (Sandbox Code Playgroud)
有一个接口模型:
export class VideoListModel {
constructor(
public created_at: …
Run Code Online (Sandbox Code Playgroud)