angular mat table with API, | Populate API data into Angular mat-table - 2022

↔️ ↕️


hello beautiful people thank you for joining  us again today in today's video i'll show you  

how you can populate my table from an api today's  video we will be using this api service is a list  

of countries i also did a video about how  you can confess countries and fetch state  

and fetch cities or if you can add that to your  form you can check out that video the link is  

added somewhere here in this video so we have  the regular angular material table with demo data  

which is what you have but today we will just  replace those data we have this demo data here  

today we'll be replacing this data with an  api call from that api service if today's  

your first time watching our videos thank you  so much please don't forget to subscribe don't  

forget to hit the notification bell so you can  always get notified when we upload a new video  

and also leave us a comment let us know what you  think about the video it helps us to do better  

right hit the like button if you like the video  okay without further delays uh let's get to it

so as you can see i already have this demo data  from angular material side it's just all of this  

i have also created this service we're going to  use to consume the api i also have a model country  

there's nothing inside of it we're going  to fill it together this is going to hold  

the countries when i fetch them i also made  a video detailed about making api calls so if  

you're feeling overwhelmed you can just check out  that video is a lot more into okay so the first  

thing i want to do is go to the country uh the  api and then read the documentation for this one  

it requires you to have this is the api  the endpoint you need to call and then  

uh it requires some key which i already have  gives to heaven okay joking all right and this  

is what we're expecting an id name and iso  2 so this i'm going to create in the model

all right so i have created the model for the  country the next thing is to actually make the  

Related queries:

how to fetch data from an api in angular
how to get data from an api in angular