Hi,

I'm a beginner with Angular9. So, I need to display data with coming to 
HTTP url(GET API link). Please help me to solve this problem.

Here my code, It's wrong. Help me to solve this.

import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { map, catchError} from 'rxjs/operators';

interface Course {
    description: string;
    courseListIcon:string;
    iconUrl:string;
    longDescription:string;
    url:string;
}

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})

export class AppComponent {
    courses$: Observable<Course[]>;

    constructor(private http:HttpClient) {
    }

    ngOnInit() {
        this.courses$ = this.http
            .get<Course[]>("https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";) 
// HERE URL
            .map(data => _.values(data))
            .do(console.log);
    }
}

-- 
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 angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/d709fb9e-4df6-41ca-8d00-31b0aee63078%40googlegroups.com.

Reply via email to