Observable in Angular 13 | auto refresh after database update | communicate components using service

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024

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

  • @adalanane41
    @adalanane41 Год назад +2

    Yo man Im doing my final year final project of angular web app and angular ionic mobile app and only found this channel now. IF i found this channel 6 months back i myt be an angular pro by now XD. Keep up the good work man your videos are interesting and covers almost all difficulties we face in angular. And i also shared this channel among my friends who are doing angular projects as a thanks for these great videos!!

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

      Thanks for your wonderful words. It's the energy booster for us

  • @laughandtune
    @laughandtune 11 месяцев назад

    you are just refreshing the table by using get all method...hence you are loading all the data once again, which is not correct in real world scenario, please correct me if I'm wrong.

    • @NihiraTechiees
      @NihiraTechiees  11 месяцев назад

      There is the other approach we can include last inserted record into the array then it will reflect in UI. I followed this approach in my ngrx video.
      If you have limited records you can directly call. If records are high then performance issue will come

  • @AlexeyHariton
    @AlexeyHariton 5 месяцев назад

    Man, shrink that video to Subscribtion and you'll help millions. :D

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

    I don't have any get all method that get all values getting from service how will call in init..??

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

      What is your actual requirement please share to mail

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

    This code is terrible, where do you unsubscribe from your observables?

  • @ReactWithSamwize
    @ReactWithSamwize 5 месяцев назад

    Your code hurts my eyes, can't you format or write code in a clean way.

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

    Thank you so much sir. can you make video on angular file download from aws s3 bucket.

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

    Why didn't you convert your fetch data by code http request into a promise. After that you could have call it on every refresh

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

      I tried to explain promise also in this video that's it. If you watch the full video you will get

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

    Compare with call method getall again?

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

      Almost yes. If something in the same components directly we can call. Action in once components but need to call getall in different components need to use observable

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

    How to update view with new values without hitting the database to GetAll?

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

      When it need to be update? I mean which event

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

      @@NihiraTechiees i meant we updated the data it should reflect on the view without hit GetAll() again. May be like using BehaviorSubject ??

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

    Can you please make some videos on ngrx state management

  • @dinadinakaran1522
    @dinadinakaran1522 Год назад +1

    neenga veramari broo this error ah nan 2 days ah solve panna try pantr but ur the greate .. nandri anna

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

    19:54 But this way we have multiple subscribe as GetAll() service?
    Wouldn't it be more correct to unsubscribe first?

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

    Bro one small suggestion pls increase ur voice little bit bro so many videos using headphones too ur sound cant reach us so pls from ur next videos increse ur voice little bit more then only can learn ur video without using headphone .thank you for all ur efforts

  • @VijayKumar-fq4ie
    @VijayKumar-fq4ie Год назад

    Oh its very important video with a good explanation but how i was missed it.

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

    Hi
    My data are coming from db side.. I want both DB and angular table to be in sync, so any changes happened in db it should reflect in angular table immediately. Can I use the same implementation which you showed in this video.
    Also one more question when I am refreshing the page from browser button it not loading, it is showing white blank page for all pages. Why it is.?
    Pls clear my both doubts

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

      Yes you can follow same steps for your video.
      Your 2nd question regarding blank screen it may comes bcz some error. Could you check the console

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

      @@NihiraTechiees I followed the same steps to get updated data but it is not coming.. After I switch to another tab and come back then it is updating... I was updating one column value in db side and was checking in angular web page...

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

    But bro, you dont need to do that, you directly can use a Promise, and avoid to create a extra observable to subscribe and call getAll(), because now also you need to unsusbscribe...soo why are you doing in this way?

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

      Promise is outdated in latest versions

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

      Now you have to use firstValueFrom() to get a promise, but it doesn't answer the question

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

    Very useful video for dynamic refreshing. Thank you so much

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

    The required refresh implementation is awesome! God bless you!

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

    Thank you for the explanation Sir. But, I am getting "ERR _INSUFFICIENT_RESOURCES" after subscribing to the RefreshNeeded declared in my service. Any thoughts??

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

      I believe you missed something could you crosscheck with GitHub source code

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

      @@NihiraTechiees Thank you Sir. Identified the root cause... I am getting the response to an array variable. Now, I changed to observable. Its working now. But the problem is that, during edit, I am getting the data from database to the respective controls. Now, on page load by default all "select" components show the first data. Is this the default behaviour Or can i still map the data to the respective controls for editting?

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

      Select control should show exact value. If it's choosing first one selected. Then check your api return the exact value and select control option value

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

    Wow.HatsOff Brother.What an Excellent stuff.All Angular Lessons are really great.Fantastic Bro.God Bless you.

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

    Great explanation. Thank you so much.

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

    In simple words what is mean observable and promise

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

      Observable is one of the rxjs feature for hold and transmit the data to different receiver.
      For getting data from observable your to subscribe or topromise it

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

    is it possible to implement pathlocationstrategy and hashlocationstrategy in a project at time?

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

      Let me check

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

      @@NihiraTechiees ok it will help me a lot please help. The main problem in our project is that all the routings we used are hash routing but for one controller we need to implement path location routing and is there a way to implement both at a time?

  • @Fadi.nouh88
    @Fadi.nouh88 Год назад

    this is very junior way, just use NGRX and that's it :)

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

    WOWOWWOWOWOWOWOW!. You saved my project.

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

    thank you it really helped me!