Angular Tutorial - 21 - Fetch Data Using HTTP

Поделиться
HTML-код
  • Опубликовано: 16 сен 2024
  • 📘 Courses - learn.codevolu...
    💖 Support UPI - support.codevo...
    💖 Support PayPal - www.paypal.me/...
    💾 Github - github.com/gop...
    📱 Follow Codevolution
    + Twitter - / codevolutionweb
    + Facebook - / codevolutionweb
    📫 Business - codevolution.business@gmail.com
    Angular | Angular Tutorial for Beginners | Fetch Data Using HTTP

Комментарии • 353

  • @Codevolution
    @Codevolution  6 лет назад +39

    *There is a change in rxjs version 6. Please watch this video to fix that.*
    ruclips.net/video/ScaKGrW5s0I/видео.html

    • @FieelFlying
      @FieelFlying 6 лет назад

      Awesome, thank you!

    • @manishjuniwal7755
      @manishjuniwal7755 6 лет назад

      Very nice.....thnx.....do upload more videos

    • @ifthikkarudheent1159
      @ifthikkarudheent1159 5 лет назад

      iam using angular7 when i subscribed to observable it is showing error " cant find name 'subscribe' "

    • @miradama
      @miradama 5 лет назад +8

      @@ifthikkarudheent1159 Delete the ";" for the line before the .subscribe(data...

    • @tolubrand5330
      @tolubrand5330 4 года назад +2

      can you please explain why we are creating an employee inetrface as we know what data is coming from backend and we can directly use it and subscribe it..

  • @Saurabh2816
    @Saurabh2816 4 года назад +134

    Jeez, this video could win an Oscar if there was a category for 'Most clear explanation to a complex topic'.

    • @rembautimes8808
      @rembautimes8808 3 года назад +1

      Second vote that - I was stumped for several hours on this , opening dozens of Stack Overflow and Angular IO files on how to accomplish this. The nice thing is how the interface was used to map the data. Vishwas does a great job for Angular newbies like myself ( total Angular experience ~ 16 days )*
      *From Python land , which is awesome but they don’t have material Ui

    • @Realswagoverlord
      @Realswagoverlord Год назад

      Agree 110%

  • @BaharBatool
    @BaharBatool Год назад +5

    For angular14 and other issues
    >> import {Observable} from 'rxjs';
    >> in subscribe() define the data type of 'data' FOR EXAMPLE .subscribe((data=any)=>)
    >> also in employee = [ ] do employee:any instead
    Overall everything is working completely fine.

  • @rshraddha
    @rshraddha 3 года назад +6

    These videos deserve more views. I am currently learning angular and your videos are by far the best. You explain step by step in such an easy way that anyone would easily understand the process.

  • @sn66410
    @sn66410 4 года назад +6

    your Angular series saved me from assignments, love your short and clear videos. Thank you!! ☺

  • @ДмитрийПавловский-д8э

    Man, thanks so much for your tutorials with detailed explanation! I started learning Angular with your videos.

  • @vanzinvestor
    @vanzinvestor 5 лет назад +42

    Angular 7 use
    *import { Observable } from 'rxjs';* instead of import { Observable } from 'rxjs/Observable'

    • @venkatsai-
      @venkatsai- 4 года назад

      hello man did u get any solution for this

    • @CREED.32
      @CREED.32 4 года назад +3

      @@venkatsai- What he has given IS the solution.

    • @NoName-vw9hl
      @NoName-vw9hl 3 года назад

      Thank you so much

  • @Krazness
    @Krazness 4 года назад +5

    You are a Godsend. I'm loving this series. Thank you!

  • @coltonpekar2675
    @coltonpekar2675 2 года назад +4

    when I try the subscribing code, I get an error for the 'employee = []; cant assign type x[] to type never[] can someone help

    • @adnankhuwaja1234
      @adnankhuwaja1234 2 года назад +2

      public employee:any[] = []; this will solve your problem

  • @mirci5459
    @mirci5459 Год назад

    Man, I love you! You explained so clear that even I undersrand. I mean, I spent really 9-10 hours to figure out how this schema works and you explained it within 2 videos. Glad you do this content! Even after 5 years from video appeared, it is still helpfull!

  • @Guinhulol
    @Guinhulol 5 лет назад +7

    Fix for those who are having issues with Observable on Angular 6+ just run the command "npm install rxjs-compat" then you should be good to go

  • @c4chachu500
    @c4chachu500 4 года назад +1

    great video...your clear audio, presentation screen, way of presentation, and words you have used, everything made this tutorial perfect and easy to grasp...

  • @satyamthassu1509
    @satyamthassu1509 5 лет назад +1

    one of the the likes that you are getting every day on your videos one by one are mine! Good work dude! I Subscribed on just completing your first video.!

  • @jonatasge
    @jonatasge 5 лет назад

    I do not speak and I do not understand English, but I was able to understand and learn a little Angular with your video.
    Thank you very much.

  • @MZ-uv3sr
    @MZ-uv3sr 3 года назад +1

    Oh wow that cleared up a lot very quickly. Also thank you for using a good readable font size.

  • @moduthoms
    @moduthoms 6 лет назад

    Very good explanation. Not even Angular official site tutorial explains like this.

  • @yunus5949
    @yunus5949 5 лет назад +6

    Is creation of IEmployee structure unnecessary? putting instead, works

  • @Kim-hm4nb
    @Kim-hm4nb 6 лет назад +2

    Hi, Sir, thanx for making tutorials on Angular 6. i learnt a lot of concepts from your tutuorials such as Di, Observables...etc
    i think your concepts are crystal clear! and also your teaching methodology is so much awesome!
    i like the way as you teach.
    Sir i'v a request, kindly make a tutorial on LOGIN AND REGISTRATION SYSTEM in MEAN STACK 6 or at least 5 using mongoose
    i am waiting your response imran khan from Lahore, Pakistan

  • @fernandogomez83
    @fernandogomez83 4 года назад

    Man thank you for this video. You thought me Redux and now you are teaching me Angular. :D

  • @akshaygupta6321
    @akshaygupta6321 5 лет назад +3

    Good Job man!!!very good way to explain the concepts in a easy way..Thanks

  • @hakkihantunbak6340
    @hakkihantunbak6340 2 года назад

    What an unbelievably clear explanation. Wow.

  • @anandmane3634
    @anandmane3634 2 года назад

    I have been watching you angular videos and I have learned alot. Thanks...

  • @babarhussain6557
    @babarhussain6557 4 года назад

    your video channel is very helpful for so many members and also very helpful for how are started as a beginner

  • @daviddonadze221
    @daviddonadze221 6 лет назад

    no one has explained this subject the way u did it. love your videos.

  • @bobbycvsixfour5258
    @bobbycvsixfour5258 6 лет назад

    best described Observable and Subscription ever (starting at 5:20)

  • @Samuel-np5ng
    @Samuel-np5ng 6 лет назад +4

    I'm trying to do the same but, my employees array is always undefined. The data has the content and it is asigned to my array in the subscribe method because if have checked it. However, when the method its finished I check again my array employees and its empty, as if nothing had happened.

  • @lorem349
    @lorem349 2 года назад +1

    For those getting error in the json array file,
    1) Replace all the single quotes with double quotes (can be done easily by using ctrl+h in vs code)
    2) Remove the comma from the last value of every object in the array

  • @purnimabaranwal
    @purnimabaranwal 2 года назад

    Perfect way to explain. Thanks for putting so much efforts.

  • @XTheFinalJokerX
    @XTheFinalJokerX 4 года назад

    Best explanation ever, veri simple and with examples. Well done, you saved me

  • @rekhamari8736
    @rekhamari8736 4 года назад

    Your video nice..i'm fresher so after two time watching your video then only I can understand....tq....

  • @jt.633
    @jt.633 2 года назад

    thank you for this! you're a very good teacher and clear communicator!!

  • @sasikaadesh8184
    @sasikaadesh8184 Год назад

    Really Really useful. Very well explained. Thanks a million! Please do more video.

  • @Vij2011
    @Vij2011 3 года назад

    I like your examples, as every video is independent of previous video.

  • @avinashsorab5026
    @avinashsorab5026 4 года назад

    Best explanation by far. Understood how Observable works under the hood.

  • @randallp.5578
    @randallp.5578 2 года назад

    This is still such a helpful video.. This helped me understand Observables a bit more, thank you very much! will you post any videos using Angular 14?!

  • @bawagrafix
    @bawagrafix 5 лет назад

    Thank God till this tutorial I didn't got stuck anywhere, got running everything. Thanks

  • @AGUNGKAYA
    @AGUNGKAYA 3 месяца назад

    your explanation is the best. Hope you make more content with Angular's new features also

  • @merlingrim2843
    @merlingrim2843 6 лет назад +14

    FYI - if your import of Observable is failing because you are using version 6 then try this:
    import { Observable } from 'rxjs';

    • @TopsilogYum
      @TopsilogYum 6 лет назад

      it is going to be automatically imported on VS code, it was puzzling at first but yeah

    • @Guinhulol
      @Guinhulol 5 лет назад +2

      For those who are using Angular 6+ just run the command "npm install rxjs-compat" then you should be fine.

    • @bawagrafix
      @bawagrafix 5 лет назад

      In Angular 6, this is done automatically, great

    • @miradama
      @miradama 5 лет назад

      Also applied to Angular 7: import { Observable } from 'rxjs';

  • @TheMiguel891
    @TheMiguel891 6 лет назад +1

    thanks man!! I was finally able to make it work, your explanation is great!

  • @edsalazar4590
    @edsalazar4590 6 лет назад +2

    Excellent video series on Angular. I really appreciate the work you have done. Thank you!

  • @sillapriyadarshni7255
    @sillapriyadarshni7255 Год назад

    error solves:
    1. if there is error in subscribe, then check if there is a semicolon in before line. If it's there, remove it.
    2.correct to public employees=[] as any; in both employee list and employee detail components
    3. remove last semicolon in employee.json
    4. correct it to import { Observable } from 'rxjs';

  • @malithsachintha9084
    @malithsachintha9084 4 года назад

    your explanation is great. This was very useful. Thank you

  • @luckyv7597
    @luckyv7597 3 года назад

    superb and awsome tutorial. Thanks alot for sharing. now I understood clearly . Great Tutorial

  • @PakachiWalid
    @PakachiWalid 6 лет назад +1

    Man, you just saved my day .. I have been searching for you for a long time !! THNX

  • @HK-sw3vi
    @HK-sw3vi 4 года назад

    there are rarely any video that I like first then start watching

  • @mcaldex
    @mcaldex 4 года назад +2

    This is really useful. Thank you so much!

  • @billfrost5257
    @billfrost5257 5 лет назад

    Really helpful and worked first time on Angular 8.

  • @sonumarathe07
    @sonumarathe07 5 лет назад

    one of the best angular series... Thanks Sir

  • @efrainespaderocanaviri3265
    @efrainespaderocanaviri3265 4 года назад

    Thanks Friends, your are the best, I'm learning so fast. I could understand about services and observables.

  • @atharvsingh310
    @atharvsingh310 5 лет назад +2

    HI viswas Thank you for making such a nice video. i have one confusion please help me.
    I have already setup Angular project and i have to create so many pages and each page have some static content. so
    my question is for each pages i need to create new component and for each component i need to create new services? or there is other way to do this.
    please make one video how to feach data from Database

  • @oviyathiruvalluvanar7687
    @oviyathiruvalluvanar7687 3 года назад

    very clear and neat explaination.thankyou so much👌

  • @VOLTDOGmusic
    @VOLTDOGmusic 5 лет назад +2

    I had an issue locating my employees.json file, I had an assets folder within src/app/assets and one within src/assets, I deleted the one in src/app/assets and put the json file in the src/assets folder directly and this got my app to work!
    Hope this helps anyone!

    • @ahmedsalahahmed8387
      @ahmedsalahahmed8387 4 года назад

      I think you should add the file as an asset in the angular.json file

  • @gangamshow5945
    @gangamshow5945 4 года назад +2

    Great video!! What if i want to show only the people that have the name wich start with A?

  • @galleeandfarel
    @galleeandfarel 2 года назад

    awesome explanation, the best in youtube

  • @souravnaik6355
    @souravnaik6355 3 года назад

    Brilliant explanation . Keep up the good work sir !!

  • @Gimmiyimmy
    @Gimmiyimmy 6 лет назад

    Very well explain.. You clarified my doubts. Thank you so much.

  • @shubhamtiwari9428
    @shubhamtiwari9428 4 года назад

    appreciative work!! crystal clear concept till services thank you

  • @absarkhan2288
    @absarkhan2288 6 лет назад

    you are superb sir, and your all videos are amazing.

  • @harshaeranda3321
    @harshaeranda3321 6 месяцев назад

    When god think I'm gonna teach anguler service today❤

  • @jmmmmmmmmmk
    @jmmmmmmmmmk 8 месяцев назад

    Thank you, good job explaining.

  • @AnkitMishra-mo3dv
    @AnkitMishra-mo3dv 5 лет назад +1

    I am using Angular 8
    I have written code according to this video.
    But the detail of Employee list is not showing.

  • @akhilgusain2866
    @akhilgusain2866 6 лет назад +1

    Liked it very much. Please continue making such videos.

  • @martinez92100
    @martinez92100 3 года назад

    Amazing explanation of observables

  • @xinhang5334
    @xinhang5334 3 года назад

    Thank you so much for the explanation! It helps a lot.

  • @ruudhermans4243
    @ruudhermans4243 5 лет назад

    At 4.20 you must end the propertie names for the interface using a semicolon. No clue why it does not give you a warning but it's not a JSON-object.

  • @sourabhdwivedi5418
    @sourabhdwivedi5418 4 года назад

    Very nice way of explanation

  • @thisvasilyev
    @thisvasilyev 5 лет назад +1

    In general, quite a useful video.
    But in fact, the result is a memory leak in employee-list.compopent.
    You can solve this problem by assigning a subscription to a variable. eg this._subcription = this._employeeService.getEmp. And execute this._subcription.unsubscribe() in ngOnDestroy.
    Or it is better to not subscribe at all. Instead, display data through the async pipe in the template. This is the best practice - because Angular will take care of unsubscribe
    .

  • @ponyatnoeit169
    @ponyatnoeit169 3 года назад

    Nice step by step explanation 👍

  • @md.julhashossain9758
    @md.julhashossain9758 6 лет назад

    So Cool Man !!!... Just Described On to the point .. Great Work. !!!

  • @branden8028
    @branden8028 6 лет назад

    This is the best tutorial on the subject. Thank you sir!

  • @KamalSharma-zw3fl
    @KamalSharma-zw3fl 4 года назад

    wow you are perfect, you are a very good teacher

  • @kolos4650
    @kolos4650 6 лет назад +20

    Thanks man, this helped me. And even more, this made mE to subscribe(); to your channel!
    *Bdum tsss* :)

  • @KangoV
    @KangoV 6 лет назад +1

    How would you code this to return an Observable and not the whole array? For example, in Java you you would do this with a Single, not an Observable.

  • @thomaslohmann9361
    @thomaslohmann9361 6 лет назад

    Nice tutorial. What about post, put and delete methods? It would be nice if you could make a video about all CRUD operations.

  • @nitindelhiful
    @nitindelhiful 6 лет назад +3

    at 4.10 instead of commas maybe we should seperate properties in an interface with a semi colon;

  • @DeepakGupta-s1z
    @DeepakGupta-s1z Год назад

    you helped me a lot. Thanks

  • @AhamedKabeer-wn1jb
    @AhamedKabeer-wn1jb 3 года назад

    Beautifull explanation..

  • @romeshfernando2959
    @romeshfernando2959 3 года назад

    Saved my day thanks

  • @mo_2212
    @mo_2212 5 лет назад +1

    you are PRO BRO, keep cool and thanks!!

  • @chennaiahp5765
    @chennaiahp5765 4 года назад

    Very good explanation

  • @brendan2240
    @brendan2240 3 года назад

    Amazing and simple explanation.

  • @AshishSingh-op2ul
    @AshishSingh-op2ul 6 лет назад

    The Big one Bro...Completely understandable

  • @mainulhasan35
    @mainulhasan35 6 лет назад

    Thanks a lot! Your series is really useful.

  • @chetankshirsagar3124
    @chetankshirsagar3124 4 года назад

    thanks for the explanation..

  • @disha9876
    @disha9876 5 лет назад +1

    You are Amazing! Thankyou.

  • @harikareddy7526
    @harikareddy7526 3 года назад

    Really helpful. thank you

  • @bluepill9131
    @bluepill9131 4 года назад +1

    I notice on employee-list component you did not define “data” after you subscribed to the observable. Is that because the subscribe method knows that data means the information received from the observable?

    • @woodiemarv
      @woodiemarv 4 года назад

      Thought I could help. Yes you are correct. data is just a variable name in the context and could have been anything. ex c1 => class variable = c1

  • @shivalikakamboj8391
    @shivalikakamboj8391 Год назад

    those who are getting error in importing observables write import { Observable } from 'rxjs'; instead of import { Observable } from 'rxjs/Observable'; .

  • @章魚-l8y
    @章魚-l8y 2 года назад

    Awsome video man, I learnt a lot from your tutorial.
    May I know why we need to have underscore when naming a private variable? Is it necessary?

  • @drorcohen285
    @drorcohen285 3 года назад

    Thank you , You saved my life !!!!

  • @ashishchauhan5203
    @ashishchauhan5203 2 года назад

    Hey man please use jsonplaceholder for API tutorials. Hard coded data is a big no no.

  • @Jenson-M-John
    @Jenson-M-John 4 года назад

    Observed & Subscribed This Channel.

  • @baibhavghimire3827
    @baibhavghimire3827 3 года назад

    Watching this and not subscribing will be unfair. :)

  • @robyirloreto
    @robyirloreto 6 лет назад

    Excelente...mejor imposible...bien explicado...Gracias..Saludos desde Venezuela

  • @ahmedsalahahmed8387
    @ahmedsalahahmed8387 4 года назад

    What about returning an array of employees instead of observable from the getemployees function and how it is implemented

  • @williamsbron2686
    @williamsbron2686 3 года назад

    the content is great
    keep going ahead♥♥

  • @hajnel4597
    @hajnel4597 2 года назад

    This is great !! Thank you so much !

  • @prasaddeshkar7
    @prasaddeshkar7 4 года назад

    Hi,
    why do we use employee interface and not employee class. What is the benefit of using interface ?

  • @moMo-yq3zt
    @moMo-yq3zt 4 года назад

    Omg it works, thank you! I have subscribed!

    • @rachnasingh8976
      @rachnasingh8976 4 года назад

      Please tell me how it works and showing content...
      Plaese let me know

  • @NitinKatiyarCircle
    @NitinKatiyarCircle 5 лет назад

    Why we have subscribed for the service get method in component instead of parsing it in service itself and then return it to components. This way we can centralized the parsing. Any specific reason??