Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- heroes => {
- this.heroes = heroes; // tre sa ai definit in clasa heroes ca Hero[]
- heroes.map(hero => { // map aplica functia asta pt fiecare element din array adica fiecare hero
- const heroUrl = 'http://clean.com/user/' + hero.uid + '?_format=hal_json';
- this.http.get<Hero>(heroUrl).subscribe( //aici faci requestul si se va aplica pt fiecare erou pt ca e inauntrul map-ului
- currentHero => { // asta e raspunsul de la http request
- // aici tre sa iei currentHero.name sau ce proprietate vrei tu si sa o pui in array-ul heroes la id-ul corespunzator si gata
- }
- )
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement