Angular's New Model Inputs: Two-way Communication with your Child Components

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

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

  • @atlaslion1746
    @atlaslion1746 6 месяцев назад +12

    You're great Deborah!

  • @valikonen
    @valikonen 4 месяца назад +2

    I love Angular and his new vision!

  • @cathyf5449
    @cathyf5449 4 месяца назад

    Great video Deborah. Clear and easy to understand.

  • @ErickCcsVzla
    @ErickCcsVzla 6 месяцев назад +2

    Excellent video, as usual 🎉
    In the minute 10:50, in the parent component's code, "amount" should be "value", for the example to work, I believe.
    Thank you for the awesome video.

    • @deborah_kurata
      @deborah_kurata  6 месяцев назад +2

      Thank you so much.
      And yep, you are right. The component code doesn't correctly match the HTML binding. But it was supposed to be the other way around (so as not to be confused with the 'value' from the child). "value" in the component code was supposed to be "amount".
      amount = signal('');
      length = computed(() => this.amount().length);
      Bummer that there is no easy way to update a posted video! (I will add it to the video notes.)
      Thanks again!
      Deborah

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

    Hello Deborah Kurata,
    Thank you so much for your tutorials, they are very effective and impressive. I have a question: if I have a list of products and I want to view the details of a product in a separate component using the routing "/product/1", and I used a signal to get the details of the selected product, but I have a problem: when I refresh the page, I lose the data, which is a normal behavior. Can you help me solve this problem without exposing the observable to the component (meaning I want my signal to be filled from an HTTP call when refreshing the page).

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

    Thank you so much for another fantastic video, Deborah

  • @patty518
    @patty518 12 дней назад

    can you please clarify why on line 14 we send listFilter to the child, and on line 17 we send listFilter()? I assume we add the () to listFilter in because we are listening to changes to the value, whereas is not reacting to changes, but I was under the impression we always want to reference a signal with () at the end of the signal name.

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

    Great video, beautiful pedagogy.
    Thx from France. 🙏🏻

  • @ArchitecturalAesthetics2046
    @ArchitecturalAesthetics2046 2 месяца назад

    didn't know that writing the 2way binding in long form is to add ...Change to the event binding name. thanks for the video, very informative.

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

    I am a visual learner and your presentation is extremely intuitive. I like it when you show "before" and "after" visually. I assume this approach may not work if I want to write a reactive programming, correct? I am still learning about Angular Signals.

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

      Glad it was helpful!
      To answer your question, it depends on what you are reacting to. The techniques shown in this video are helpful when the parent component needs to react to changes made in the child component. The user types a filter into the child component textbox and the parent component can react to that change, displaying the length of the filter string or passing the result to another child component.

  • @codeSurvivor
    @codeSurvivor 6 месяцев назад +2

    Nice video, very well explained, thanks!
    I've never liked the two way data binding, for me it seems as an anti pattern that a child component class can modify the parent component class properties. I prefer using an output event and let the parent modify anything that belongs to itself, making it explicit. ..

    • @vutruong4164
      @vutruong4164 6 месяцев назад +1

      I understand the sentiment. But 2-way binding is just another tool, if you use it in correct situations, like Form building, it can literally saves you a ton of code.
      At the end of the day, the outcome is the same, isn't it. The data on parent is being edited, either if you use 2-way binding like Angular, or you pass a callback fn that edit the "parent's data" to the child like the React's way.

    • @codeSurvivor
      @codeSurvivor 6 месяцев назад +2

      @@vutruong4164 In my case it makes a big difference, and that's because I work with a team of front-end developers, some of them with not a very good understanding of programming principles. So this kind of things that don't follow, e.g., SOLID principles, open doors for coding practices that spread like viruses in our projects... Of course, if they become better then, they'll know when to use stuff like this or not, and why, but that takes time...and viruses spread really fast ;-)

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

    Thank you so much for sharing. I love your approach, simple and effective :)

    • @deborah_kurata
      @deborah_kurata  6 месяцев назад +1

      That is kind of you to say. Thank you!

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

    Clear and easy to follow as always ^_^
    Since your great at explaining these in detail I feel a video where you show how you can use signals to manipulate populated data in like a grid from and API endpoint might make for an interesting video. Just how the whole setup, kind of pieces all the recent videos together would show how to communicate from parent to child and use signals to manipulate data after it is populated from an endpoint.
    But regardless I find your videos very informative and great to link to my juniors etc that are learning angular. And are always good review material for myself especially with the newer things like Angulars New Control Flow.

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

      Thank you for the kind words and for the suggestion!

  • @Jose-ru2wf
    @Jose-ru2wf 5 месяцев назад

    I think the video should cover how to implement multiple outputs. For example, a todo item with 3 outputs for edit, delete, and change status. Should each one be a separate model() with its corresponding [(thingy)]; or should it be a single "state" object like in React?

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

    Great video! Applying this solution of signals two way binding here. It is working fine, but my IDE (IntelliJ) is show error in the html on the [(modelVariable)] at the parent. The error is: "Can't bind to [(modelVariable)] since it is not provided by any applicable directives". Do you have any ideas how to fix it?

    • @deborah_kurata
      @deborah_kurata  5 месяцев назад +1

      Thank you.
      Regarding your IDE, it looks like jetbrains said they fixed it: youtrack.jetbrains.com/issue/WEB-65415/Angular-17.2-model-input-support#:~:text=WEB%2D66429,on%20top%20of%20general%20support:
      Do you have the latest update of IntelliJ?

    • @GustavoAranhaReis
      @GustavoAranhaReis 5 месяцев назад +1

      I'll update it! Thanks a lot

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

    Thank you very much Deborah :)

  •  6 месяцев назад +2

    Hi Deborah, I used your courses to training new junior devs when they start onboard period, but now yours introductory courses are removed from Pluralsight, where I can found this type of courses made by you?

    • @deborah_kurata
      @deborah_kurata  6 месяцев назад +5

      Thank you for asking!
      The Pluralsight courses weren't removed, just retired. You can still find them with the links here: app.pluralsight.com/profile/author/deborah-kurata
      Pluralsight won't allow me to update the "Getting Started" saying that it wasn't needed since they have an "Angular Fundamentals" in their library. I have done a new RxJS course for Pluralsight.
      I'm considering redoing my "Getting Started" course here on RUclips, but I haven't finalized a plan as of yet.

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

      @@deborah_kurata Thanks @deborah_kurata Considering redoing that on platform that we can buy your course, on Udemy for example.

    • @deborah_kurata
      @deborah_kurata  6 месяцев назад +2

      @ I was never able to get passed their automated verification system and I couldn't find a person to talk to about it. So I can't post to Udemy.
      Do you think posting the course here on RUclips would be useful?

    • @Robd515
      @Robd515 6 месяцев назад +1

      Hi Deborah, big fan here. It would be useful for sure, but also make sure you’re getting compensated for the in depth courses. So RUclips may not pay off. Consider creating your own website to sell your videos. All in all, we just want you to be motivated to keep it up :)

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

      @@deborah_kurata posting the course here on RUclips would be useful!

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

    Deborah the video is great but just a note here.
    You are referring to the relation between app-filter and app-snack-list as a parent-child relationship. Hmm... I would say that they are siblings.
    The parent child relationship is between app-snack and app-filter. the same goes for app-snack and app-snack-list.
    So the examples here are more about how two-way communication can be helpful between sibling components being under the same parent (umbrella) . My 2 cents

    • @deborah_kurata
      @deborah_kurata  6 месяцев назад +1

      Thank you!
      You are correct that the parent-child relationship is between app-snack and app-filter. That is the relationship I'm talking about. The techniques I presented only work between the parent (app-snack) and the child (app-filter).
      The fact that I'm also passing the value onto the other child component is basically irrelevant to the topic. I considered removing the second child component (app-snack-list) from this demo to prevent confusion, maybe even moving that code into the parent component. But I thought that would be confusing for anyone who watched both videos.
      I apologize for this confusion. Would it help if I did a second stackblitz showing the techniques without the second child?

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

      @@deborah_kurata no worries, I tried and implemented by myself all the example you mentioned in the video just to have a more clear view and I think I got it now . Thank you for your help :) 😊

  • @manikandaprabakaran6849
    @manikandaprabakaran6849 2 месяца назад

    Picture Perfect 🥰

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

    Thank you for the video!

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

    Amazing! Thanks! :)

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

    When do you drop the update getting Started With Angular ?

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

      Are you asking why I have not updated my "Angular: Getting Started" course on Pluralsight? It's because Pluralsight won't allow it.
      I'd asked numerous times over the past almost two years and they've said no. Since they have an "Angular Fundamentals" course, they don't think that they also need an "Angular: Getting Started".
      I'm considering redoing the course for RUclips (I can't just repost the original course because Pluralsight owns it.)

    • @SuperMukama
      @SuperMukama 6 месяцев назад +1

      @@deborah_kurata That is sad. I hope you will work things out.

  • @programmingpracticals8643
    @programmingpracticals8643 25 дней назад

    in the last slide amount should be signal like you made lastFilter as signal...please make ur silde correct or make me correct

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

    Very nice thank u!

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

    great job ❤

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

    This used to be possible by adding Change to the output parameter name something like that @Output() childDataChange = new EventEmitter(); and using banana in the box syntax in the component

    • @deborah_kurata
      @deborah_kurata  6 месяцев назад +1

      Yep! (I cover that in the video. 😊) But with model inputs, it's one line of code to create the model input ... no need to create the @Input, @Output and do the emit.

  • @raj.blazers
    @raj.blazers 2 месяца назад

    Great

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

    Love you!

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

    Great 🎉

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

    How to do this in reactive form input?

    • @deborah_kurata
      @deborah_kurata  6 месяцев назад +3

      My understanding is that the Angular team is still working on signal-based forms. So hopefully some time soon?

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

    Deb ♥rah!!

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

    Game changes.