Angular Material - Custom Form Field Control [Advanced, 2020, Pt.2]

Поділитися
Вставка
  • Опубліковано 12 лис 2024

КОМЕНТАРІ • 29

  • @DecodedFrontend
    @DecodedFrontend  3 роки тому

    📣 Check out my full Angular Material Theming Workshop 📣
    bit.ly/angular-material-theming-workshop
    Use 50%-off coupon code: THEMING-WORKSHOP-LAUNCH

  • @DecodedFrontend
    @DecodedFrontend  4 роки тому +8

    Thank you all for watching my videos! Please let me know if you like such in-depth videos or maybe you prefer videos without diving into source code etc?
    I appreciate any feedback from you and don't forget to share this video in Social Networks if you find it useful 😉

    • @ekhlasmridha6659
      @ekhlasmridha6659 4 роки тому +2

      Always like to learn in-depth features.

    • @greg6618
      @greg6618 4 роки тому +1

      Could suggest small improvement: when you've started implementing methods of control value accessor at ~2:30 and mentioned your video about them, it would be nice to add popup hint with link to it, so the ones who haven't watched it could follow right away, without searching for it.

    • @DecodedFrontend
      @DecodedFrontend  4 роки тому

      @Greg thank you, Greg! it is great suggestion, you're absolutely right. I have added it ;)

  • @Iam_AndersonP
    @Iam_AndersonP 4 місяці тому

    very cool video, I was looking something similar, but not for a FormGroup but fgor a single formcontrol, and i can't get it to work with reactive forms and material inputs

  • @chacataplan
    @chacataplan 11 місяців тому

    Hello, good tutorial, I tried it but I have version 15 of angular material and "CanUpdateErrorStateCtor" was removed from version 13, what was it replaced with? thank you!!!!

  • @gund_ua
    @gund_ua 4 роки тому +5

    Nice work on this one also mixins are awesome!
    I noticed you had a bug in your setDisabledState method - you always set your form into disabled state without checking the argument isDisabled.
    Otherwise amazing work! Keep it up =)

    • @DecodedFrontend
      @DecodedFrontend  4 роки тому +4

      ah yes, you are right! I have missed it somehow. Thanks for hint and feedback 😉

  • @dmitriy5906
    @dmitriy5906 4 роки тому +3

    Wow It is really cool, mixins is very useful I was looking for something like it. Can I use multiple mixins

    • @DecodedFrontend
      @DecodedFrontend  4 роки тому +1

      Thank you for your feedback! Yes , you can. As example you can extend it with disbabled mixin like mixinDisabled(mixinErrorState(SearchInputBase)); Just do not forget to extend mixin class type with CanDisableCtor like this: * CanUpdateErrorStateCtor & CanDisableCtor*. I have updated source code in GitHub repo and this case you can find there

  • @aram5642
    @aram5642 2 роки тому

    You have published such a lot of freaking awesome videos that I don't really know where to start binge-watching! Thanks for taking your time to prepare and record all those vids, and for sharing your knowledge! I was wondering what your thoughts are about the strongly type forms. I have been experimenting with generics, tried to strictly type arrays and groups, but it opens Pandora box of TS problems. Am I the only one?

  • @alpinestylecom
    @alpinestylecom 3 роки тому +1

    Nice Video! What i am missing is the exact benefit of using the mixin instead of the Errorstatematcher? Can you say something about it? Greetings vom Tirol.

    • @DecodedFrontend
      @DecodedFrontend  3 роки тому +2

      Servus! :) Good question, actually the mixin ( mixinErrorState as example ) uses under the hood ErrorStateMatcher, so you can't say that "you are using mixin instead of the ErrorStateMatcher". If you have a look at the source code of the mixin you will see that it defines `errorStateMatcher` property ` updateErrorState()` method which contains logic which checks if your control is in an error state and also emits `stateChanges.next()` . If you are not using mixin you need to implement it on your own when using of mixin just allows you to reuse some logic from angular material library :)
      P.s here is the link to a source code of mixin: github.com/angular/components/blob/4ae90cc278bd7beafc5806fd34dd3434d7058c0d/src/material/core/common-behaviors/error-state.ts#L38

  • @socialist_king
    @socialist_king 4 роки тому +1

    Love your work, keep up the good work and the feedback on the comments.

  • @bennyt1635
    @bennyt1635 4 роки тому +1

    Love your videos! Especially the CDK ones 😊 I’ve never managed to find good videos on rendering components dynamically based on JSON object which can vary in structure per user. Any advice on how to do this?

    • @DecodedFrontend
      @DecodedFrontend  4 роки тому +2

      Hi! Thank you very much for such a great feedback :)
      I have never tried to do it in my projects but one friend of mine released recently a library which does exactly what you need. Here is the link: github.com/orchestratora/orchestrator
      But they still have an old readme and there is no “quick start” tutorial or something like this yet, however they have a demo app in that monorepo, so you can investigate a little bit the app and source code or get in touch with author for more info😉

    • @bennyt1635
      @bennyt1635 4 роки тому +1

      Dev Plus Plus amazing! Thx 😊

    • @DecodedFrontend
      @DecodedFrontend  4 роки тому

      Welcome 😊

  • @bonnes04
    @bonnes04 3 роки тому

    Amazing work
    If possible can you add another video to make that component more reusable so that you can pass country list (Array or Observable) as input decorator. so you pass other kind of list

  • @КириллСазонов-м4ц
    @КириллСазонов-м4ц 4 роки тому +1

    good job. Thanks.

    • @DecodedFrontend
      @DecodedFrontend  4 роки тому

      спасибо! Рад, что понравилось 😉

  • @ekhlasmridha6659
    @ekhlasmridha6659 4 роки тому

    Don't know why, but i am not getting updated form value when submitting the form using a button.

    • @DecodedFrontend
      @DecodedFrontend  4 роки тому

      Hi, thank you for a question. Could you please provide some Stackblitz code example?

    • @ekhlasmridha6659
      @ekhlasmridha6659 4 роки тому

      It has some styling problem i think, but same as i typed in my vs code.

    • @DecodedFrontend
      @DecodedFrontend  4 роки тому

      @@ekhlasmridha6659 the thing is that you only implemented Control Value Accessor interface but it is not enough. When your internal form changes its state you have to trigger this.onChange(newValue). It is described in this video, see ua-cam.com/video/AZsw2nRxkBk/v-deo.html

    • @ekhlasmridha6659
      @ekhlasmridha6659 4 роки тому +1

      @@DecodedFrontend Oh nice, i just missed that part i think, thanks

    • @DecodedFrontend
      @DecodedFrontend  4 роки тому

      @@ekhlasmridha6659 you are welcome :)