Thanks for the video! A tip: the remove buttons should also be button tags instead of spans because the keyboard can't select a span, which is not semantic.
I haven't faced such projects in my 14-year career. While there were instances where accessibility was not prioritized, but it was maintained at a basic semantic level because implementing accessibility features costs little but provides significant convenience for users.
Very good video. Excellent explication. Im from Brazil. This help a lot in my work. Actually working in exactly this scenario. Im share with my work colleagues. Thanks!!
Nice example 👌 Just curiosity, why use FormBuilder, and not FormGroup and FormControl for build the form 😊? By the way, one good point to improve would be add an id to identify the question, because if lately would like apply some filter, the removed question with index could be different and remove unwanted question. Continue the good work 😊
i really wonder if we can add an API based validation in a dynamic form in angular 17 /18 such as captcha validation or populate cities from multiple countries in a auto complete field in nonnullable forms etc.
Hi, would you know if I have a component A which extends a directive B. And in comp. a I am in injecting a service A with inject and inside of the constructor I am also calling super and injecting the service A. The question is, am I creating 2 instances os service A? Thanks in advance.
I think it depends from few things like: if you providedin :root service A you have 1 instance of components( like singleton). But if you use providers:[ServiceA] in extendable component it will be different instances.
@@user-glory-of-ukraine yeah that’s correct. However my question was more related to the new inject where you do thing like serviceA = inject(ServiceA) In that case if we do that more than once in the same component it would create only one instance no matter how many injections you use in the component. That conclusion was based on others dev RUclips channels. Let me know if you have any points where makes that wrongly or partially correct. Thanks man
I written your example in my side and it dos not works well, for example if you add 2 question and fill those fields and then remove first question in UI side remove seconds and typescript side remove first, then i refactored code, instead of @for i used *ngFor and typescript side form control value instead of empty string i written new formControl() after that it works well; please chek your example one more time and see yourself what is going on. thanks
WATCH NEXT: Angular Interview Questions and Answers - Dominate Your Next Interview - ruclips.net/video/5A_YKlVWMPo/видео.htmlsi=2DCn7yspEAAJ2H6l
Nicely done, thank you for sharing. It might be a lot to ask but it would be very interesting to see the template drive equivalent approach.
Won't happen. Template driven forms are not flexible and I don't recommend to use them at all.
great introduction! reactive forms are very useful but also very diffcult to learn, thanks for teaching me something new!
Glad it was helpful!
Thanks for the video!
A tip: the remove buttons should also be button tags instead of spans because the keyboard can't select a span, which is not semantic.
Sure, but not each project needs accessibility
I haven't faced such projects in my 14-year career. While there were instances where accessibility was not prioritized, but it was maintained at a basic semantic level because implementing accessibility features costs little but provides significant convenience for users.
Many thanks, forms are still a thing Im sure I could be handling more effectively.
Good to hear!
Very good video. Excellent explication. Im from Brazil. This help a lot in my work. Actually working in exactly this scenario. Im share with my work colleagues. Thanks!!
Glad it was helpful!
Thank you for your work and sharing your knowledge !
My pleasure!
always the best angular instructor on youtube !!! thank you very much ( I'm french dev, sorry for my english)
Wow, thanks!
Thank you 💯🔥
Any time!
Great video
Thanks!
Thanks,
It would be really useful to have a form builder that automatically types the form according to its initialization
I agree
excellent... thanks a lot
Most welcome!
Nice example 👌
Just curiosity, why use FormBuilder, and not FormGroup and FormControl for build the form 😊?
By the way, one good point to improve would be add an id to identify the question, because if lately would like apply some filter, the removed question with index could be different and remove unwanted question.
Continue the good work 😊
There are different ways. Use what is comfortable for you. Sure you can also use IDs
NonNullableFormBuilder - thank you :)
My pleasure!
i really wonder if we can add an API based validation in a dynamic form in angular 17 /18 such as captcha validation or populate cities from multiple countries in a auto complete field in nonnullable forms etc.
You can simply use formData.setErrors({errorMessage:item.errorMessage}) after you make your API call.
Hi, would you know if I have a component A which extends a directive B.
And in comp. a I am in injecting a service A with inject and inside of the constructor I am also calling super and injecting the service A. The question is, am I creating 2 instances os service A? Thanks in advance.
I think it depends from few things like: if you providedin :root service A you have 1 instance of components( like singleton). But if you use providers:[ServiceA] in extendable component it will be different instances.
@@user-glory-of-ukraine yeah that’s correct. However my question was more related to the new inject where you do thing like serviceA = inject(ServiceA)
In that case if we do that more than once in the same component it would create only one instance no matter how many injections you use in the component.
That conclusion was based on others dev RUclips channels. Let me know if you have any points where makes that wrongly or partially correct.
Thanks man
Many thanks :)
You're welcome!
How to insert new form at index?
Good
Thanks
I'm that 20%, love you since I found you haha :P
That's awesome!
Problem. We get a bug if:
1) Create a second input
2) Set it to some value
3) Delete the first input
P.S. the problem with the index
If it's an index problem it makes sense to work with elements by ID then
@@MonsterlessonsAcademy But you can only delete by index)
You are correct , change @for with *ngfor and typescript side use new formcontrolName()
I written your example in my side and it dos not works well, for example if you add 2 question and fill those fields and then remove first question in UI side remove seconds and typescript side remove first, then i refactored code, instead of @for i used *ngFor and typescript side form control value instead of empty string i written new formControl() after that it works well; please chek your example one more time and see yourself what is going on. thanks
Thank you for letting me know
Final result has empty string at first answer, probably solution has mistake somewhere
Very nice way to strongly type, typed forms! 🦾
Glad you like it!