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

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

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

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

    🔥Learn how to build really complex form controls like select dropdown with multi-selection WITHOUT Angular Material in my new advanced course about Angular Forms bit.ly/advanced-angular-forms 🔥🔥🔥

  • @swapnasaritnayak2569
    @swapnasaritnayak2569 3 года назад +9

    Easily the most interesting angular tutorials in youtube. This deserves more subscribers.

    • @DecodedFrontend
      @DecodedFrontend  3 года назад +1

      Thank you! :) hopefully soon the subscriber counter will be appropriate!

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

      100%

  • @jakobbauer7886
    @jakobbauer7886 4 года назад +2

    I searched for what feels like a decade for this solution. Multiple medium articles & the angular documentation didn't explain it as well as you did. Really great work for a very specific topic. Keep it up!!

    • @DecodedFrontend
      @DecodedFrontend  4 года назад

      I am happy to hear it, thank you very much! :)

  • @DecodedFrontend
    @DecodedFrontend  4 года назад +3

    Custom form field controls are heavily used feature in any web application and now you know how to achieve it without “hacking” things 😄 In the next video we will add support of Angular forms!
    P.s Don’t hesitate to leave your feedback and criticism 😉

    • @DecodedFrontend
      @DecodedFrontend  4 года назад

      ​@@blackcat3422 Hi, Thank you for your feedback!
      Do you want me to commit to GitHub also that state with "empty" components which I created at the very beginning of the video? Do I understand right?

    • @DecodedFrontend
      @DecodedFrontend  4 года назад

      Хаха) та да, куда там с индусами тягаться))
      Да, всё верно, я тоже из Украины😁 И спасибо ещё раз за отзыв и идею коммитить начальный стейт👍🏻

    • @DecodedFrontend
      @DecodedFrontend  4 года назад

      Конечно) не вопрос. Желаю успехов!

  • @webmandman
    @webmandman 4 года назад +3

    Keep it up bro. You will reach 1 million soon. Great content.

  • @DecodedFrontend
    @DecodedFrontend  3 года назад +1

    📣 Check out my full Angular Material Theming Workshop 📣
    bit.ly/angular-material-theming-workshop

  • @ekhlasmridha6659
    @ekhlasmridha6659 4 года назад +4

    It was really interesting and easy to understand, thanks

  • @conatcha
    @conatcha 10 месяцев назад +2

    Thanx a lot man. You helped me a lot.

    • @DecodedFrontend
      @DecodedFrontend  10 месяцев назад

      Glad to hear that! You're welcome 😊

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

    Hey Dmytro, what's the best explanation of the difference between "custom form control" and "custom form field control" that you can give? These two concepts are a bit confusing for someone new to them.

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

      Hi :) Oh... good question. Well, I would say that "form control" is an element that allows users to change model data via interaction (input, select, etc.). The "form field" is a reusable component that surrounds the "form control" and defines some common visual elements that are used by different types of controls (labels, icons, etc.). For both, the "custom" prefix just highlights that elements are different from the native ones and were created for some exact use case.
      Saying "custom form field control" is probably not the best wording, so I apologize if I said it somewhere in the video I made you confused :)

  • @greg6618
    @greg6618 4 года назад +4

    Your videos is super useful. I will try to implement a custom field too, after watching this. It will definitely help me later, on my work project, cause we have a lot of different inputs and forms. TY! ☺️

    • @DecodedFrontend
      @DecodedFrontend  4 года назад

      Glad it was helpful! Have fun with forms 😀

  • @CamiloBenavidesE
    @CamiloBenavidesE 4 года назад +2

    Great! Thanks for your tutorial

  • @michaelfischelmayer176
    @michaelfischelmayer176 4 года назад +2

    Great content!

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

    Great lesson! Thank you.

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

    Awesome video, thanks for teaching and sharing

  • @intergral81
    @intergral81 3 года назад +1

    Wow this is amazing and super useful. thank you for what you are doing

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

    Really nice video, helped me a lot! thx

  • @farfazzi
    @farfazzi 3 года назад +2

    terrific content. is there a github repo for this?

    • @DecodedFrontend
      @DecodedFrontend  3 года назад +3

      Thanks! Yes, there is a link. Check a video description
      Upd: or just follow github.com/DMezhenskyi/angular-cdk-lessons

  • @Ghanshyam1987
    @Ghanshyam1987 4 года назад +1

    Great learning, Thank you very much. Could you please let me know best way to manage interface and models in Angular

    • @DecodedFrontend
      @DecodedFrontend  4 года назад +1

      Hey! Thanks for you question. Well, there is no the only 1 right solution. Usually I use separate file for it which I call typings.ts and store interfaces there or create a file some-entity.model.ts which lives in some corresponding module folder and being exported via index.ts. It is usually matter of taste 😊 but definitely I would not store it in component, service, pipe etc files

    • @Ghanshyam1987
      @Ghanshyam1987 4 года назад

      @@DecodedFrontend Thanks but is there any way to avoid duplicates of model and interface through out the application

    • @DecodedFrontend
      @DecodedFrontend  4 года назад +1

      but you will not duplicate them. You can import models from one module to another without duplication. Also you can create shared folder in your app and share you entity classes and interfaces from there. If you need to share models across a multiple applications then you could create a library where you store models & interfaces. I do the same approach in one of project I am working on. I have a server written with TypeScript and NG App. And all my entity interfaces are living in this library, so I can reuse them in Backend App and also in Angular application.

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

    I was hoping to find the solution to a slightly different scenario I’m facing.
    I have an app and a ui library.
    In the ui library I have a simple MySearchComponent which simply implementa ControlValueAccessor and in it’s template I’m using the whole mat-form-field boiler plate, instead of just a plain input, to have the app completely unaware of Material.
    In my app, where I use my-search component, everything works fine, except the validations. I see the correct validation state and control errors in my app where I use my-search. But in the ui library, it seems that MySearch component ia not aware of the fact that the control is invalid, because Material doesn’t do its thing regarding styling, it appears as ng-valid amd doesn’t have the input border with the error color and so forth. Also, I have a mat-error in the ui component which should simply display a string from an inout, and that doesn’t work either, because in the ui component the control is seen as valid, and it appears that Material doesn’t display the mat-error if the input is valid. Not sure how to make it work, while respecting the requirement, which is to completely abstract Material from the app where I use the ui library. So I can’t have mat-form-field or anything from Material in the app 🤔
    Edit: I've watch part 2 as well, but somehow it's still different enough from my use case that I can't make it work such that the mat-form-field is aware of the validation and control errors :|

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

    doing this in Angular 13 and running into problems. When you're setting the value in the container's template, I get the error "Type 'string' is not assignable to 'FormFieldValue'". Not sure what to do, everything else is exactly as you have it.

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

      This is because the text values do not convert to the FormFieldValue interface as it is an object so to fix this: in your custom...container.html set the [value]="value.scope". (scope is the property in the interface which holds the country code), then in search...container.html set the [value]="{scope:'at', query: ''}" (note the query is blank value between 2 single quotes

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

      @@dandavey293 I'll give that a shot. thanks!

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

      @@davidgriffin7632 any issues let me know and I'll help you

  • @alvaropuertas5873
    @alvaropuertas5873 3 года назад

    thanks! very useful video!

  • @redrox1307
    @redrox1307 3 года назад +1

    thanks. helped a lot :)

  • @bonnes04
    @bonnes04 3 года назад

    thank you for this great content... next time can you do angular material date picker with time picker

  • @ganeshkumarchandrasekaran
    @ganeshkumarchandrasekaran 3 года назад

    Been following you and you make excellent videos, can you please make video series on the internal working/ code of angular material, also fyi I have subscribed to your theming workshop.Thanks for your efforts.

  • @zhdanvadim9536
    @zhdanvadim9536 3 года назад +1

    Круто, спасибо!

  • @RajeshYadav-ee2jf
    @RajeshYadav-ee2jf 3 года назад +1

    Hi sir could you please provide full angular tutorial. That would be great help for me in my challenging career.

    • @DecodedFrontend
      @DecodedFrontend  3 года назад

      Hi Rajesh!
      At the moment I don’t have any full angular course but I can recommend you a course I used in the beginning of my angular career and it is still relevant. Here is a link bit.ly/angular-for-beginners

    • @RajeshYadav-ee2jf
      @RajeshYadav-ee2jf 3 года назад

      Thank you sir surely will help this in my goal achivement

    • @RajeshYadav-ee2jf
      @RajeshYadav-ee2jf 3 года назад

      I'm waiting for your Full course sir

  • @syimykamatov8955
    @syimykamatov8955 4 года назад +1

    Thanks

  • @VendettaUkraina
    @VendettaUkraina 4 года назад +1

    Nice

  • @syimykamatov8955
    @syimykamatov8955 4 года назад +1

    👍