💥 Angular Signal Inputs (COMING SOON in Angular 17.1)

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

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

  • @AngularUniversity
    @AngularUniversity  9 месяцев назад +2

    To learn in detail Angular Signals, check out the Angular Core Deep Dive Course - angular-university.io/course/angular-course👍

  • @ConstantinosConstantinides-y2o
    @ConstantinosConstantinides-y2o 9 месяцев назад +8

    I totally recommend Angular University. Very good quality of learning material! Both the blog and the video courses.

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +1

      Thank you, it's awesome to hear that 😊 Please enjoy the courses 👍

  • @Nabulio85
    @Nabulio85 7 месяцев назад +1

    I've been following you since I started programming in 2019.
    Thank you Vasco.

    • @AngularUniversity
      @AngularUniversity  7 месяцев назад

      You're welcome, I'm happy to hear that 😊 I'll keep the videos coming 😉

  • @malikau917
    @malikau917 9 месяцев назад +1

    Since now you will be my main resource of angular news! :)

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад

      Thank you, stay tuned for more coverage of the Angular ecoystem 😊

  • @samuelsantanarivera
    @samuelsantanarivera 9 месяцев назад +2

    Excellent content, Greetings from COLOMBIA!!

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

    I have been with angular since angular2 was in alpha. Can’t state enough how awesome signals is. Thank u Angular team! Great video.

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

      Yes the same for me, it's an awesome framework😊

  • @AlainBoudard
    @AlainBoudard 9 месяцев назад +2

    Thanks for sharing Vasco ! Always good Angular content !

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +1

      My pleasure Alain, thanks for watching and please enjoy the new content. 👍😊

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

    Great content as always!

  • @zetalivsanns5360
    @zetalivsanns5360 9 месяцев назад +2

    Thanks professor 🫡

  • @besara_
    @besara_ 9 месяцев назад +2

    greate vedio as usual

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад

      Thank you, it's awesome to hear that. 😊 Please enjoy the channel. 👍

  • @DisturbedNeo
    @DisturbedNeo 9 месяцев назад +1

    That transform option is crazy. You can map data with a reusable transformation function on a per-component basis that updates automatically whenever new data comes in, directly in the input signal. Insane.

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад

      I love the new transform option too, it replaces the need for getters and setters and certain uses of ngOnChanges, very nice. It's also available for the regular @Input decorator. 👍

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

      Just don't abuse it

  • @flanderstruck3751
    @flanderstruck3751 9 месяцев назад +1

    Thank you very much! Very well presented :-)

  • @LarsRyeJeppesen
    @LarsRyeJeppesen 9 месяцев назад +1

    Signal inputs are soooo cool

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад

      I love them too, makes the whole signal approach much more appealing. Looking forward to application wide reactivity. 😉

  • @fernandoh.7965
    @fernandoh.7965 9 месяцев назад +3

    I think I have a problem when I use input.required, in my unit tests
    in my console it shows error code NG0950

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад

      weird, this could be an issue, remember this is still in RC0

  • @sivuyilemagutywa5286
    @sivuyilemagutywa5286 9 месяцев назад +4

    This is way easy now, I always hated doing Geters and Seters,

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +2

      I like it too, it's way better this way 🙂. For getters and setters, there are now input transforms that replace most of the use cases.

    • @LarsRyeJeppesen
      @LarsRyeJeppesen 9 месяцев назад +2

      NgOnChanges even worse, hate that sh.. signals are soooooo nice

  • @seekthetruth5458
    @seekthetruth5458 9 месяцев назад +2

    Great video and explanations! What if a signal comes from a service to a grand parent component then is passed to a parent and then to a child? Do input signals work with the nested trees of components and preserve their reactivity on every level?

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +2

      Thank you 😊 If the signal is passed around through components via a service, all consumers of the signal will be notified of new values. Check out the video on Signal-based data services here on the channel. 👍

  • @omarabdelhameed1066
    @omarabdelhameed1066 9 месяцев назад +1

    Great video ❤

  • @yufgyug3735
    @yufgyug3735 9 месяцев назад +1

    i like the direction angular is taking with these signals, new template syntax etc. the only problem in quick adoption of newer angular versions is sketchy update cycle of packages my projects depend on.

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +1

      The Angular CLI makes is super easy to upgrade between versions, and you have this website to help also with upgrade notes - update.angular.io 👍

  • @francescoguagnano1212
    @francescoguagnano1212 9 месяцев назад +1

    Hi, how to use features like changes.value.firstChange or changes.value.previousValue in the new effect function?

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад

      Signals only emit the last value. I think for that specific use case you could use the RxJs interoperability. 👍

  • @paulh6933
    @paulh6933 9 месяцев назад +2

    is there any word whether it will be experimental or production?

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад

      I didn't see it mentioned anywhere yet. I think they will put in developer preview first, as they usually do.👍

    • @DisturbedNeo
      @DisturbedNeo 9 месяцев назад

      Yeah, my guess is it'll be marked as experimental in 17.1, and made stable in 18.0

  • @Dmooney777
    @Dmooney777 8 месяцев назад +1

    Can you do two-way binding with input signals?

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

      There is no two-way binding with signals, you need to invoke the signal with () as a function to get a value, and you need to call set or update on it to modify the value.

  • @MukeshRathore86
    @MukeshRathore86 9 месяцев назад +2

    Have we covered course on micro-frontend using angular? I am asked to work on it in my organization.

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +2

      We didn't cover micro-frontends so far on the channel, that is something that I could look into. I think with Angular, it would be a matter of giving each frontend a separate build, and they could share a common shared module.

    • @MukeshRathore86
      @MukeshRathore86 9 месяцев назад +1

      @@AngularUniversity The challenge we are facing right now is when there are multiple team working on different github repository and we need to have communication between those unrelated components after deployed on server.

  • @Michel000000001
    @Michel000000001 9 месяцев назад +2

    I really enjoy your content! So clear, and also just a bit more indepth so I don't get stuck on building the first real feature for myself.
    If you like this content: this expert also has a great site where you can get a subscription on all his content for a moderate fee, and a course on Udemy, which is packed with info and updated to the latest versions; this Udemy course is almost for free. Lots of thank you from the Netherlands 🙏

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +1

      Thank you Michel, please enjoy the channel and the courses. 😊

  • @Dajuhf
    @Dajuhf 9 месяцев назад +1

    effect isn't just to log things and not indicated to use to code inside it?

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +1

      Effect is not just meant for logging, that is just an example of a typical side-effect. You can use effects for any typical side effect, liek writing to local storage, writing to the database in the background, writing to a cookie, logging, etc. If you want to calculate derived data, use the computed API instead. 👍

  • @francescoguagnano1212
    @francescoguagnano1212 9 месяцев назад +1

    Hi, what about performance since signals are functions and in the template it’s being binding a function to get signal value and since in Angular it’s better to avoid function binding to not have performance issues?

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +1

      It's not a problem at all. When full signal-based reactivity is available, and everything is plugged into change detection, it will be faster this way.😁

    • @francescoguagnano1212
      @francescoguagnano1212 9 месяцев назад +1

      Mmm however I created a small project with a standalone component and with change detection onpush and in the template I put in binding a signal in a paragraph and a button that at the click increments a counter in a very normal variable that has nothing to do with the signals (I only did it to be able to trigger the click event) and then I debugged the signals.mjs file of angular/core precisely in the getter function contained in the createSignal function and my fear was confirmed because despite having an onpush component, the getter function of the signal is called clicking on the button that does not update anything , so they did not really solve the problem of the functions in binding.

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +1

      @@francescoguagnano1212 Mostly signals are not yet plugged in with change detection. they are not plugged into normal change detection, and with OnPush they are only integrated in very particular scenarios. Signals right now provide a nice alternative to Rjxs for writing reactive shared data services, but the change detection benefits are not here right now; Signals are a work in progress. 👍

  • @ansumanmishra9608
    @ansumanmishra9608 9 месяцев назад +1

    What are the advantages of signal based inputs?

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад

      These are reactive inputs, the main advantage is that it makes it super simple to implement your components in reactive style using signals.

    • @DisturbedNeo
      @DisturbedNeo 9 месяцев назад

      It means that when a value changes, only the components using that value will re-render. With input signals, you could theoretically write an entire Angular application with Zone.js disabled, and you'll never have to learn about change detection strategies.

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

    My biggest problem with this is that i can't be initializing all my objects for the inputs every time. But if i don't, then angular will make the signal , and then i have to have a gazillion checks that the value of the signal is not undefined before i do something, otherwise typescript always complains. Is there a workaround or better way of doing this?

    • @AngularUniversity
      @AngularUniversity  8 месяцев назад +1

      You can use input.required instead, and make the field mandatory. You can also give the signal an explict type, to avoid the | undefined.

    • @trimalakismeno
      @trimalakismeno 7 месяцев назад

      @@AngularUniversity even if i give it an explicit type e.g. user = input.required() angular initializes this with 'User | undefined'. I guess the input.required is a better solution. But if I misunderstood your solution please let me know bcs I'd like to get around this

  • @USONOFAV
    @USONOFAV 9 месяцев назад +1

    would input signal display the value on the console without effect block? Like, just put console.log(${this.value()}) ?

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад

      You mean if you log on the constructor? It would only do that once, it wouldn't call again console.log. The effect is needed for the logging statement to be called again with each new value of the input, as a side effect.

    • @AlainBoudard
      @AlainBoudard 9 месяцев назад

      Yes, Signals are not streams like RxJs Observables so you need to plug into effect or computed callback.

  • @seekthetruth5458
    @seekthetruth5458 9 месяцев назад +1

    Also it pretty much looks like Angular is leaning towards React and Vue's concepts of reactivity. So similiar and easy to use compared to RxJS.

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад +2

      Yes there is a convergence, and with the upcoming functional authoring format that seems to be in the works it will be even more so. RxJs will become optional and outside the main learning path. Angular is really taking off. 🚀😊

    • @LarsRyeJeppesen
      @LarsRyeJeppesen 9 месяцев назад +2

      React doesn't use Signals afair. React also does not have local detection (sections of a component); which Angular will have very soon

    • @seekthetruth5458
      @seekthetruth5458 9 месяцев назад

      @@LarsRyeJeppesen that's true - no signals in React, but they have useState hook that operates like signals.

  • @besara_
    @besara_ 9 месяцев назад +1

    i hope webstorm consider this update from now, not like 17 update

    • @AngularUniversity
      @AngularUniversity  9 месяцев назад

      Me too, with a bit of luck they are on top of it. I like Webstorm a lot.