У меня есть следующие интерфейсы
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;
}
И служба, которая возвращает Observable<StudentsData>
getStudentsData(orderBy?: string, orderDirection = 'asc'): Observable<StudentsData> {
return this.http.get<StudentsData>('/api/students', {params})
}
Можно ли использовать Observable<StudentsData>
и создать Observable<Stundet[]>