Interfaces: create and split shows-api.ts
This commit is contained in:
parent
0a6fda1512
commit
22cc1dcc01
4 changed files with 10 additions and 8 deletions
|
|
@ -1,9 +1,3 @@
|
|||
export interface ShowsApiResponse {
|
||||
status: string
|
||||
shows: Show[]
|
||||
totalShows: number
|
||||
}
|
||||
|
||||
export interface Show {
|
||||
_id: string
|
||||
title: string
|
||||
7
src/interfaces/shows-api-response.ts
Normal file
7
src/interfaces/shows-api-response.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import {Show} from './show';
|
||||
|
||||
export interface ShowsApiResponse {
|
||||
status: string
|
||||
shows: Show[]
|
||||
totalShows: number
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import {Component, inject} from '@angular/core';
|
||||
import {ShowsApiService} from '../../services/shows/shows-api.service';
|
||||
import {Show, ShowsApiResponse} from '../../shows-api';
|
||||
import {Show} from '../../interfaces/show';
|
||||
import {ShowsApiResponse} from '../../interfaces/shows-api-response';
|
||||
|
||||
@Component({
|
||||
selector: 'app-shows',
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import {inject, Injectable} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {Observable} from 'rxjs';
|
||||
import {ShowsApiResponse} from '../../shows-api';
|
||||
import {ShowsApiResponse} from '../../interfaces/shows-api-response';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue