I have two URLs like this:
private URL="http://127.0.0.1:8000/api/product/?category=3"
private me="http://127.0.0.1:8000/api/product/?category=2"
Currently I'm able to get one of them.
service:
private URL="http://127.0.0.1:8000/api/product/?category=3"
private me="http://127.0.0.1:8000/api/product/?category=2"
getApi():Observable<any>{
return this.http.get (this.URL)
}
component:
ngOnInit() {
this.api.getApi()
.subscribe(
data => this.todo=data
);}
How can I get those URLs inside one Observable and how to subscribe them in my component?