#Angular Material - Error State Matcher for Form Fields (2021)

preview_player
Показать описание

---------------
In this advanced angular tutorial, we will have a look at ErrorStateMatcher - the interface which controls when to highlight the error state for angular material form fields. By default, angular material inputs turn red as soon as input has been touched but is it always the behavior we expect? I don't think so... that's why we have ErrorStateMatcher which gives us control over this behavior. It is going to be very interesting. Enjoy watching :)

📣 Become a Pro in Angular Material Theming (Advanced Workshop) 📣
✅ Use 10%-off coupon code: YOUTUBE_DISCOUNT (Only 2 coupons left)

📣 Blazing fast GraphQL Backend just in 1 Day with Hasura Engine 📣
✅ 20%-off coupon code: HASURA-EASY-START

🔗 Everything about Angular Dependency Injection in this playlist:

🔗 Link to the source code on GitHub:

#webdevelopment #frontend #angularpatterns
Clicking on affiliate links you help the channel to grow.
Рекомендации по теме
Комментарии
Автор

📣 Check out my full Angular Material Theming Workshop 📣
Use 50%-off coupon code: THEMING-WORKSHOP-LAUNCH

DecodedFrontend
Автор

I can't really stress enough how helpful your videos have been for me. Your free videos are 10x better than any of the paid courses I've taken so far.
Thanks for all of your hard work 💓.

wolfisraging
Автор

There is not much content about this topic. It was really helpful, thanks!

koraykural
Автор

You are incredible.
I'm from Brazil and one of my bugs in Jira was to resolve this problem of the error message being printed in the wrong situation.
You just helped me a lot and save a lot of my time.
Thanks!

rasenganxchidory
Автор

If try this by installing angular 16 and copy Dmytro's code in, you'll get an error:
Property 'name' comes from an index signature, so it must be accessed with ['Name']. Alternately for a quick fix you can go into your tsconfig.json file and change false, fom true to false.

Thanks Dmytro for another great video.

davesharman
Автор

It's very useful and helpful.... Thanks * 3000

bonnes
Автор

Wow, exactly what I was looking for. Excellent!! Thank you!

djb
Автор

Very clear and useful! Thank you, and waiting for a new videos!

Valdemar
Автор

dude i was strugling last days with this, thank you for that!

bruno
Автор

Hey, nice video! How do you test it though? is there a mock, you create one or you just provide it?

PaulliMr
Автор

Thank you. When to use updateOn:blur. Can we use it in forms? which has input onBlur and form button onClick validation. In form onCIick the update:on blur not triggers. Input is an autocomplete and & called in form as an child selector.

Dinesh-irhq
Автор

Is there any good practice for displaying error messages under input instead of ifing in every control?

adamweber
Автор

How would you tackle the case of a dynamic form? E.g. You wouldnt have hardcoded error messages but everything would come from an http request (validation rules, messages, field types etc.).

thodoris
Автор

Great content!

Also cool to see you linking Maximilian's Udemy course for beginners.
Too often I see content creators only ever promoting their own content, which makes me question their overall judgement. Not the case here.

bobby_tablez
Автор

Hey Dmytro and thanks for your videos! I got a dilemma tho, how do you trigger the errors on form submit if it's needed to implement an MatFormFieldControl ?

mirciulicasm
Автор

For some reason, that I didn't understand, the solution in the module level, didn't work for me.

danilo_teixeira
Автор

You forgot to delete the instance of the CustomErrorStateMatcher that you created initially — you don't need it as you've done it via Dependency Injection

pashabolokhov