I have the following interfaces
export interface Student {
id: number;
firstname: string;
lastname: string;
birthdate?: Date;
created_at: Date;
updated_at: Date;
contacts: Contact[];
contacts_attributes: Contact[];
}
export interface StudentsData {
students: Student[];
count: number;
offset: number;
limit: number;
}
And a service, that returns an Observable<StudentsData>
getStudentsData(orderBy?: string, orderDirection = 'asc'): Observable<StudentsData> {
return this.http.get<StudentsData>('/api/students', {params})
}
Is it possible to use the Observable<StudentsData> and create an Observable<Stundet[]>?