Fetching Data with Get requets | Angular HTTP | Angular 13+

In this lecture we will learn how to fetch data from the server and display that data in the web application. To fetch data from the server we use GET request and to send a GET request to the server, we can make use of get() method of HttpClient.
In this lecture you will learn:
1. How to send get request to the server?
2. How to transform the response returned by the server?
3. How to display the response data in the webpage.
DOWNLOAD STARTUP PROJECT HERE: drive.google.com/file/d/1cYuD...

Пікірлер: 21

  • @ShubhamShekhar
    @ShubhamShekhar7 ай бұрын

    I've explored numerous Angular tutorials, but this one stands out as truly exceptional. The clarity of instruction and depth of content make it a superior learning resource, providing valuable insights and enhancing my understanding of Angular development.

  • @BrisLS1
    @BrisLS18 ай бұрын

    This was great. I built my copy by using a List component and an Add component, and having Add do an Emit, List then executes a Refresh by getting called through ViewChild. No need for refresh buttons. Best wishes!

  • @user-iy9wn5mq6o
    @user-iy9wn5mq6o Жыл бұрын

    just a neat and clean explanation.. i found it wonderful.. thank you sir for the wonderful explanation

  • @sachinvarghese2223
    @sachinvarghese2223 Жыл бұрын

    Question: In 'onProductCreate()' , i used 'onProductFetch()' method also in method definition, so that when i create a object, it will automatically gets displayed. when compiled, its not working. But when i used a setTimeout() method for 1000ms outside 'onProductFetch()'. its working perfectly. Why it's happening?

  • @kenanhaciyev3759
    @kenanhaciyev3759 Жыл бұрын

    You are the best)

  • @uthjay2331
    @uthjay2331 Жыл бұрын

    Hello sir, Is there any other way to view data in html instead of transforming/observable operators ? can we do that using *ngFor directive or forEach method ?

  • @sajithsampath217
    @sajithsampath217 Жыл бұрын

    thank you sir

  • @jimshtepa5423
    @jimshtepa5423 Жыл бұрын

    thank you for the great educational material and amazing presentation. a quick question: is there any reason for using http instead of fetch api offered by the browser?

  • @procademy

    @procademy

    Жыл бұрын

    We can surely use fetch() api from angular. But its better to use angular's built-in http to handle http request and responses. This stackoverflow query might clear your doubt: stackoverflow.com/questions/53660262/angular-http-vs-fetch-api

  • @M40A3FengZ
    @M40A3FengZ9 ай бұрын

    my API return a simple text, in angular, how can i take the result that comes in json and convert to text?

  • @mrcoleman499
    @mrcoleman4992 жыл бұрын

    I still receive the error after I change strict to false. Great videos though keep it up!

  • @sachinvarghese2223

    @sachinvarghese2223

    Жыл бұрын

    Instead of for..in method ; use this on your own risk (especially incase of nested object 😬) : for (const [key, value] of Object.entries(res)) { products.push({ ...value, id: key }); }; // no need to use hasOwnProperty() method, if we use entries() method

  • @vaibhavkutty2511
    @vaibhavkutty2511 Жыл бұрын

    good morning sir i have tried to add product but i get an error while add new product

  • @juancarlosrivera2874
    @juancarlosrivera2874 Жыл бұрын

    Great explanation, but what happened with json data that contains more than one object, i mean like a nested table? thanks for share your knowledge. btw i'm knew with angular, and sorry for my english xd

  • @procademy

    @procademy

    Жыл бұрын

    Thank you 😊. To access nested data, you can simply use dot notation. For example, let's say we have following json object: { Name:. "John", Address: { City: "London", Country: "UK" } } Now, if you want to access city field of address, which is a nested JSON object, you can access it like doc.address.city where doc is your variable storing the JSON object.

  • @shivajikoli461
    @shivajikoli461 Жыл бұрын

    sir , why you didnt use services for http methods which could be more suitable to understand

  • @arundeveloper9041
    @arundeveloper90412 жыл бұрын

    hello sir, if(res.hasOwnProperty(key)){ products.push({...res[key], id:key}); } is the problem, your download source there is no content, it is empty project setup only, please update the full code and give us

  • @sachinvarghese2223

    @sachinvarghese2223

    Жыл бұрын

    i think use Object.entries() method instead of for..in loop. I am not sure though if it leads to some error😬 ; especially in case of nested object (sorry , i am noob in coding)

  • @deresszakal
    @deresszakal Жыл бұрын

    Sir, Thx for your great course. I got cors error by the get request. I tried to set the header without success and the Firebase Realtime Database parameter setting failed too. Please help.

  • @deresszakal

    @deresszakal

    Жыл бұрын

    Sorry, I entered the url incorrectly. What confused me was that I got a CORS error. It works now. THX.

  • @lakshithakanchana6155
    @lakshithakanchana6155 Жыл бұрын

    res.hasOwnProperty(key) is useless when it put inside for(const key in res) {}. It will always be true.