```ts // YourPage.component.ts import { Component, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http'; @Component({ selector: 'document-screen', template: `

There was an error fetching the data!

Loading...

`, }) export class DocumentScreen implements OnInit { user: any = { id: 0, name: 'Some User' }; document: any = { id: 0, title: 'Some Title' }; subdocuments: any = []; error = false; loading = true; constructor(private http: HttpClient) {} ngOnInit() { this.http.get('https://your-restful-endpoint').subscribe({ next: (data) => { this.loading = false; this.user = data.user; this.document = data.document; this.documents.data.subdocuments; }, error: (error) => { this.error = true; }, }); } } ```