I am getting an error that says "property does not exist on type" but the
property does exist. I am trying to use a forkJoin. Here is the code for
that:
getCombined() {
let mainHeaders = this.http.get<Header[]>(`${this.backendUrl}/api/header`);
let subHeaders =
this.http.get<Children[]>(`${this.backendUrl}/api/header/children`)
forkJoin([mainHeaders, subHeaders]).subscribe(results => {
results[0].children = results[1];
})
}
It says "property 'children' does not exist on type 'Header[]' but here is
my header definition:
export class Header{
headerID: number;
headerName: string;
hidden: boolean;
children: Array<any>;
}
I have also tried:
import { Children } from '../definitions/children';
export class Header{
headerID: number;
headerName: string;
hidden: boolean;
children: Array<Children>;
}
Also:
children: Children;
and
children: Children[];
in the above class.
What am I missing?
Thank you in advance for any assistance!
Ronnie
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/angular/381236c4-7192-4cb8-9ca9-746010efe229n%40googlegroups.com.