🚦 Angular NgRx Signal Store Crash Course (For NgRx Beginners)

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น •

  • @AngularUniversity
    @AngularUniversity  9 หลายเดือนก่อน +14

    This is what the future of Angular is starting to look like: Signals, no RxJs, async / await, Promises 😊No music after the intro as requested, enjoy everyone 😉

    • @g3co875
      @g3co875 9 หลายเดือนก่อน

      no RxJS?, why ? Thanks for all the latest videos!, btw

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +5

      It's not needed for most cases when writing asynchronous code. The Angular team is making RxJs optional, it should become much less used in the Angular world in the future. 👍

    • @DennisFeher
      @DennisFeher 9 หลายเดือนก่อน

      RxJs is here to stay. Where are you making your claims from? You're assuming stores are the way of application development it's a thing invented to solve the pain of react apps. NO OTHER FRAMEWORK NEEDS IT.

    • @TW-go8wz
      @TW-go8wz 9 หลายเดือนก่อน

      @@AngularUniversity Do you have a source that Angular team wants to make RxJs optional? At least if you make http requests with the HTTP Client you would need to call lastValueFrom (from rxjs) to make it a Promise.

    • @TW-go8wz
      @TW-go8wz 9 หลายเดือนก่อน +2

      @@AngularUniversity Do you have a source that the Angular Team wants to make RxJs optional? This would mean that they will change e.g. the HttpClient as well to be Promise based. Would be a huge breaking change.

  • @AlRyz-y1q
    @AlRyz-y1q หลายเดือนก่อน

    Thanks for the great tutorial. I didn't got the idea that when we create signalStore here is automatic nested signal implementation. I supposed to use signalState for that. And now I have found this short paragraph in the middle on the official ngrx SignalStore page with an example :) Thanks again.

  • @angelokezimana
    @angelokezimana หลายเดือนก่อน +1

    47:16 interesting part. Thanks

  • @iantaite
    @iantaite 3 หลายเดือนก่อน

    Great tutorial. Much clearer than the official documentation.

  • @lindermannla
    @lindermannla 7 หลายเดือนก่อน +1

    The best content for Angular developers! Thnxz!

  • @termobin
    @termobin 8 หลายเดือนก่อน

    Another great job Vasco!! Thank you so much for this tutorial!!!

    • @AngularUniversity
      @AngularUniversity  8 หลายเดือนก่อน

      Thank you I'm happy to hear that 👍😊

    • @rembautimes8808
      @rembautimes8808 8 หลายเดือนก่อน

      Watched it the whole way through. Great content , hope you’re a Madrid fan 🎉

  • @josephsackeykontor4138
    @josephsackeykontor4138 5 หลายเดือนก่อน

    Thanks a lot for this video. You really nailed the explanation.

    • @AngularUniversity
      @AngularUniversity  4 หลายเดือนก่อน

      Thank you. Stay tuned for more videos!

  • @YossefMagdy-n8z
    @YossefMagdy-n8z 5 หลายเดือนก่อน

    Thanks a lot for the great explanation and effort.

  • @dac_dev
    @dac_dev 9 หลายเดือนก่อน

    thanks. simple and clear! This is gold for everyone!|

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      You're welcome, I'm glad it helped. 👍

  • @assaf2141
    @assaf2141 9 หลายเดือนก่อน

    This is once again a great tutorial!

  • @zeynalalakus4540
    @zeynalalakus4540 9 หลายเดือนก่อน

    Thanks a lot for the great explanation and effort. 🎉

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      You're welcome, enjoy the videos 😊

  • @CasualTramp
    @CasualTramp 9 หลายเดือนก่อน

    Wow thanks a lot ! You won a new follower

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      Thank you and welcome to the channel 😉

  • @jeffleigh5291
    @jeffleigh5291 9 หลายเดือนก่อน +4

    Vasco, what would be very helpful is how to use Firestore as a backend with signal-store

  • @estevaoterci
    @estevaoterci 7 หลายเดือนก่อน

    Great Vasco, Great! Dark theme ❤

  • @TW-go8wz
    @TW-go8wz 9 หลายเดือนก่อน +1

    Hey Vasco, thanks for this great tutorial. Can you make a video where you explain and use the rxMethod in the signalStore?

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      You're welcome, I'm glad you enjoyed it! 😊 Yes, I'm thinking about coveting rxMethod sometime soon here on the channel. 👍

  • @AntonioSantana-ll8il
    @AntonioSantana-ll8il 9 หลายเดือนก่อน

    Excellent video!!!

  • @bobyuan5475
    @bobyuan5475 29 วันที่ผ่านมา

    Excellent explanation and demo for ngrx store. I am using material datatable, but how can I use the data in ngrx signal store to populate the datasource, which is type of MatTableDataSource? need convert this datasource to signals? but how? thanks

  • @nelson3391
    @nelson3391 5 หลายเดือนก่อน

    Thanks a lot!

  • @Marbulinek
    @Marbulinek 8 หลายเดือนก่อน +1

    Great learning video Vasco!! I really enjoy your channel. Everything is fine for me, but I have one question about signal store metods: you are using in demo async/await for asynchronous data retrieving. Maybe idea for next quick video, angular team (in angular.dev) is strongly supporting rxjs for asynchronous data retrieve. Can you do some really really simple example of using this construction instead of simple async/await?
    Thanks, Lukas

    • @AngularUniversity
      @AngularUniversity  8 หลายเดือนก่อน +1

      The Angular team is not strongly supporting the use of RxJs, by the contrary it's saying use it if you really need it, explore other options, don't use RxJs as a default mandated best practices, RxJs is optional that is the message of the Angular Team. You can check out here my latest video on the channel for more details - th-cam.com/video/uOIdILz-Dkw/w-d-xo.html 👍

  • @harshsonar9346
    @harshsonar9346 หลายเดือนก่อน

    I recommend you to change your YT logo background from dark to something bright (preferably white), and center the logo please.
    This way, the graduation hat will be clearly visible.
    Also, to be honest the current logo looks unauthentic/unoriginal. I almost overlooked your videos 2-3 times.
    Nonetheless, thanks for creating these awesome videos!

  • @bobyuan5475
    @bobyuan5475 9 หลายเดือนก่อน +1

    Thanks for this amazing ngrx signal store tutorial. one question, how do i use store in multiple components? my understanding is the store is injected at root level, that means available to all components, i simply inject the store to multiple components, that works, but the issue the store state update is not reflect in a other components. am I missing something?

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +1

      Thank you, I'm glad you enjoyed it 😉 Correct, the store usually is a singleton, in my example I used provided in root. you can inject it anywhere. If you update the store state, it will be reflected in all components that consume store signals 👍

  • @matteoangiolucci1910
    @matteoangiolucci1910 28 วันที่ผ่านมา

    a question I'm following your implementation, when i reload the page my todos are still dispalyed and i see the spinner as well.

  • @ddgutierrez
    @ddgutierrez 4 หลายเดือนก่อน

    tnks for all!
    Man i have a question,
    we can use the hooks for init the store or is bad practice?
    another question!
    what is the best way or the best practice for prevent fetch data 2 times i mean, if i know my store is data will never change how i can prevent the fetch if alredy exist data ?

  • @cbjerg
    @cbjerg 8 หลายเดือนก่อน +1

    How do you work with store on a more complex application, where you would work with more than todos. Like users and auth and such. Do you keep it in the same store, or would you generate a store for each component?

    • @AngularUniversity
      @AngularUniversity  8 หลายเดือนก่อน

      In principle you put everything into one single centralized store. The store can be split up into features ngrx.io/guide/signals/signal-store/custom-store-features

  • @jadgeagea255
    @jadgeagea255 6 วันที่ผ่านมา

    Hello, how can I use resource() in signal store?

  • @nidinpereira5898
    @nidinpereira5898 9 หลายเดือนก่อน +5

    Nice tutorial, but injecting the service in the store and store in the service considered anti pattern. Won't it lead to cyclic dependency errors.
    Also although it's perfectly fine to use async await, feels illegal seeing it in angular 😅

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +2

      Thank you, async/await works perfectly in Angular, it always has, and the framework has great support for Promises. The official docs of NgRx Signal Store use also async/await ngrx.io/guide/signals/signal-store 😉 So it's not that illegal after all 😂

  • @mahmoudparandeh3523
    @mahmoudparandeh3523 2 หลายเดือนก่อน

    Assume that we have a multiple todo list in same page how can we handle state of the page? assume that you use providedIn: 'root' for your store. or if any better approach please teach us. thanks

  • @StephenWitter-i4g
    @StephenWitter-i4g 9 หลายเดือนก่อน +1

    Is there a specific reason you are using types over interfaces for your models?

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +1

      I just like the keyword "type" better instead of interface, it describes better what I'm trying to define. 👍

    • @marijnstapert9036
      @marijnstapert9036 9 หลายเดือนก่อน

      You also can't do exclude of an interface, so you need a seperate model for your DTO and presentation model

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +1

      @@marijnstapert9036depending on the complexity of the domain model, a separate DTO model and the mapping involved is often not necessary.

  • @MaheshKumar-bg5re
    @MaheshKumar-bg5re 4 วันที่ผ่านมา

    Is it not possible with plain angular signals?

  • @ricardomiguel7242
    @ricardomiguel7242 6 หลายเดือนก่อน

    Why do we need the effect type in constructor (filtering part) and what would happen if i didn´t wrap that code into effect function ? Thanks.

    • @AngularUniversity
      @AngularUniversity  6 หลายเดือนก่อน +1

      Effects can be put in other parts other than the constructor, like on ngOnInit, but you need to pass it an injector explicitly. The recommended pattern is to put it in the constructor, to keep things simple. 👍

  • @ScottSchafer-qz1tf
    @ScottSchafer-qz1tf 9 หลายเดือนก่อน

    Hi Vasco,
    Will you be offering the source code for this project, it would be great if you did.
    Thanks for all you do!👍👍

  • @marcodigennaro5753
    @marcodigennaro5753 9 หลายเดือนก่อน +1

    Hello Vasco, I noticed that triggering the insertion of a Todo also triggers the update of the Store. This causes the strange behavior that, if there is a completed item in the list, the last inserted todo will also be considered completed. Isn't that strange?

    • @mattthedude1
      @mattthedude1 9 หลายเดือนก่อน +1

      I've been able to track down a few other similar behaviors as well. Switching to completed, toggling a todo, and switching to pending or all will mark them all as completed. If you're quick enough, double clicking a todo will start an infinite loop. It does seem to be coming from the MatSelectList, don't know if this is a broader issue or specific to the signal interaction.

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +2

      Thank you for reporting everyone. I had a look at it this morning, simply replace the Angular Material selection list with plain HTML and a checkbox and it works. So something to do with the use of that particular material component. So it's not a broader issue.

    • @marcodigennaro5753
      @marcodigennaro5753 9 หลายเดือนก่อน +1

      @@AngularUniversity thanks

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      @@marcodigennaro5753 You're welcome 👍

  • @wiliamferraciolli5380
    @wiliamferraciolli5380 9 หลายเดือนก่อน

    thanks for the tutorial, do i need angular 17 for it? is it still in beta the ngrx store?

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      You're welcome 😊It's based on signals so it need 17, maybe it works with 16. It's not in beta it's in developer preview; It means that's ready but things might still change a bit.

  • @andr3ignacio
    @andr3ignacio 9 หลายเดือนก่อน

    What extension are you using to auto import the material components??

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      This is Webstorm, there is no extension. I'm hitting Alt Enter to import, and sometimes the imports happen without intervention.

  • @JuanPreciado-l5j
    @JuanPreciado-l5j 4 หลายเดือนก่อน

    Did you generate a repository?

  • @fuldrew-schodyrzeszowstalo7625
    @fuldrew-schodyrzeszowstalo7625 4 หลายเดือนก่อน

    Do you have repository to look add the code?

  • @jeffnikelson5824
    @jeffnikelson5824 5 หลายเดือนก่อน

    How do you access route parameters from such a service ?

  • @Official-p5c
    @Official-p5c 5 หลายเดือนก่อน

    I am using rxMethod and now I need to use it in component. and after getting success api response I need to perform some action based on data.. how to do that ? Not able to understand

  • @bonnes04
    @bonnes04 9 หลายเดือนก่อน

    Great video. I think it's better to use real API, so we can see how to deal with Observables in signal store

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      A real API can be queries using Promises as well, it works just the same. You can use fetch, the HTTP client and convert the Observables to Promises, or use tRPC or some other more sophisticated HTTP client.👍

    • @tdekoekkoek
      @tdekoekkoek 8 หลายเดือนก่อน

      @@AngularUniversity why convert to promises though? Can't you just convert from observables to signals? I would prefer to keep my services as observables as that maintains what I have been doing pre-signals. This keeps it flexible IMO

    • @AngularUniversity
      @AngularUniversity  8 หลายเดือนก่อน

      @@tdekoekkoek Personally I think Promises are a better fit for async tasks like HTTP, that's what they were designed to do. For most applications, no event orchestration is needed so RxJs is overkill. Returning signals from the service layer, I'm not sure about that because what about error handling?

    • @tdekoekkoek
      @tdekoekkoek 8 หลายเดือนก่อน

      @@AngularUniversity thanks for your explanation. No I wasn't suggesting returning signals from the service layer, just observables and that keeps my service layer the same while introducing Ngrx Signals

    • @AngularUniversity
      @AngularUniversity  8 หลายเดือนก่อน +1

      @@tdekoekkoek The official docs of Ngrx Signals suggest to use async/await, personally I think it's a better approach and i suggest that you give it a shot, but if you want to return Observables that works too, there is a full interoperability. Myself these days i only use RxJs if I really need to, for most typical day to day operations I find it unnecessary and prefer the clarity, simplicity and readability of async/Await.

  • @mohamedaraba4028
    @mohamedaraba4028 8 หลายเดือนก่อน

    Hello Vasco thanks a lot for this tutorial 👍 Could u put the link of github repo thanks

  • @JohanVrolix
    @JohanVrolix 9 หลายเดือนก่อน

    Ha! ProvidedIn: root proved necessary using the store across different components. Is there a way to make the store perpetuate within providedIn: root?

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      Hi Johan, provided in root makes the store a global singleton, meaning it can be injected anywhere. I didn't understand the last part though, about the store perpetuating, what did you mean?

    • @JohanVrolix
      @JohanVrolix 9 หลายเดือนก่อน

      @@AngularUniversity hi Vasco, basically can you have it persist between different components without providedIn root?

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +1

      @@JohanVrolix Yes, if you put in the providers array of a parent component, that instance will be seen by the parent and the child components. If you put it into the application root component, it's almost the same as putting it in the root of the dependency injection system with providedIn root.

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +1

      but using providedIn root is recommended to a global store, this way you are 100% sure that you can inject it anywhere.

    • @JohanVrolix
      @JohanVrolix 9 หลายเดือนก่อน

      @@AngularUniversity thanks so much for the swift response and the great insights. I’m nearly finished with my first Angular app using SignalStore now

  • @JuanPreciado-l5j
    @JuanPreciado-l5j 4 หลายเดือนก่อน

    Do you have source link?

  • @renaisancijf
    @renaisancijf 8 หลายเดือนก่อน

    why we put the effects in the constructor instead of OnInit ?

    • @AngularUniversity
      @AngularUniversity  8 หลายเดือนก่อน

      Very good question, by default they won't work on ngOnInit because it's outside an injection context. you can still pass it an injection context if needed. In general with angular signals we are going to be using the constructor a lot more. 😊

    • @renaisancijf
      @renaisancijf 8 หลายเดือนก่อน

      Obrigado Vasco e congrats por sempre trazer novas atualizações ;)

    • @AngularUniversity
      @AngularUniversity  8 หลายเดือนก่อน

      @@renaisancijf Obrigado 😉

  • @KiffinGish
    @KiffinGish 9 หลายเดือนก่อน

    I see that sometimes you use double equals '==' instead of tripe equals '==='. Isn't it best practice always to use triple equals?

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      You can if you want, in principle it's better. But I'm yet to run into a case where it made a difference. 😊

  • @TechieShree
    @TechieShree หลายเดือนก่อน

    Please provide the source code if possible.
    Thanks for sharing knowledge.

  • @rishimondal3010
    @rishimondal3010 8 หลายเดือนก่อน

    Can you integrate local storage?

    • @AngularUniversity
      @AngularUniversity  8 หลายเดือนก่อน

      That's a great question, and yes sure. Right now there is no plugin for it, bit it's quite easy to do that with an effect to save the state to storage, and load it back at application startup. 👍

    • @rishimondal3010
      @rishimondal3010 8 หลายเดือนก่อน

      @@AngularUniversity can you please provide a example snippet, it will help a lot, current I am working on a login /sigin up page using firebase as backend. But after login, when I refresh it , it automatically log out the user . Plz help me on this

  • @rs4267
    @rs4267 9 หลายเดือนก่อน

    why using promises instead of observables ? by the way thanks for your course; i hope to learn new things !

    • @sulaimantriarjo8097
      @sulaimantriarjo8097 9 หลายเดือนก่อน +1

      I wonder too. I think its better to combine it with observable

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +2

      It's way simpler, no need for RxJs for writing most code; It should only be used if really needed, not for every day async code. 👍

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +2

      For most cases, aync / await works just fine. 👍

    • @g3co875
      @g3co875 9 หลายเดือนก่อน

      what scenarios / quick examples would you consider as 'mandatory' for using RxJS ? Thanks for your time!@@AngularUniversity

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +1

      @@g3co875 I don't think there are any in practice, for most applications. Things like cancellation and auto-complete search boxes which are the typical examples can be done via reusable libraries or widgets, some of which could internally even use RxJs if needed, but there is no need to use at the level of the application for doing simple things as HTTP, in my view. 👍

  • @DraaElMizan
    @DraaElMizan 9 หลายเดือนก่อน

    Hi Vasco, why don't you update the Udemy course. I've purchased your NGRX course and It will be nice it you can upate it.

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน +5

      I plan to update it with a much more in-depth dive into NgRx Signal Store, including entities, features, etc.😊

  • @johnparlato8737
    @johnparlato8737 9 หลายเดือนก่อน

    Can we view the source code for the project?

    • @AngularUniversity
      @AngularUniversity  9 หลายเดือนก่อน

      Yes, thank you for reminding me I've added the link in the description. here it is github.com/angular-university/ngrx-signal-store-crash-course

    • @ScottSchafer-qz1tf
      @ScottSchafer-qz1tf 9 หลายเดือนก่อน +1

      @@AngularUniversity The repository link does not seem to be working. Is there another place like a blog post that I could find the source code?

    • @steX1
      @steX1 9 หลายเดือนก่อน +1

      is the repo private?

  • @nergrohombre
    @nergrohombre 7 หลายเดือนก่อน

    Half way through and I am wondering why the PROMISE and not observable from an HTTP client, maybe there is something I don't see. I will keep watching. I assume you have a more in depth class for this and will watch it, I will never simulate a service like that, but I get you are trying to move fast. I probably will come back and apologize.. LOL, let me watch the whole thing!

    • @AngularUniversity
      @AngularUniversity  7 หลายเดือนก่อน

      Promises are well supported in Angular together with the async/await syntax. It's a wonderful alternative to RxJs when it comes to HTTP.

  • @miketan373
    @miketan373 หลายเดือนก่อน

    terrible this kind of programming I do not like it. I never try to program such a boilerplate stuff. I have seen better stuff from you Vasco in you courses. It's not you, it is the theme.

  • @sickboy1776
    @sickboy1776 7 หลายเดือนก่อน +1

    why don't you work on your accent? you've been recording videos for years now but you're talking with the same accent as 10 ten years ago! how can you not make any progress in that?

    • @AngularUniversity
      @AngularUniversity  7 หลายเดือนก่อน +2

      LOL people seem to understand most of what I say 😉

    • @meisterthea
      @meisterthea 5 หลายเดือนก่อน +1

      @@AngularUniversity Your accent, pronunciation is absolutely fine. Don't change anything!

    • @zbajro
      @zbajro 3 หลายเดือนก่อน +1

      Hi this accent has become as a brand so don't change it. Its perfect as soon as users hear it, it knows it's going to be great content! Thanks!