Create a Dynamic Reactive Angular Form with JSON

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

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

  • @ChandimaChathura1990
    @ChandimaChathura1990 3 года назад +24

    This is really nice to see. I'm working on a large-scale angular project for two years now. And happy to say the whole project runs with this base. This is really coming in handy when you are gonna have many forms in the project. Adding this JSON structure and standard component calling template selectors to the custom code snippets makes the productivity goes high in the sky, believe me. Nice content!

  • @jaywantnarwade5517
    @jaywantnarwade5517 8 месяцев назад

    easy step explanation, covering all scenarios regarding dynamic form . Nice work

  • @DavidLopez-dk8il
    @DavidLopez-dk8il Год назад

    This is a better solution then what I was originally looking for… very nice can’t wait to get back to my desktop and try this out for myself.

  • @123vimalan
    @123vimalan 3 года назад

    Thank you so much Joshua. Can’t describe how helpful this is. Great stuff.

  • @RamShankar-pg9cu
    @RamShankar-pg9cu 3 года назад +5

    Amazing innovative idea. You can simulate this to generate multiple forms by just defining the json config and load it dynamically. one question is how to specify List and combo boxes and load it from database and setting values to controls from database.

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

    Great presentation. Just what I need. Thanks.

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

    I love your videos and the additional discussions under every one of them - they have all been very helpful.
    Please, do your courses Angular have Purchasing Power Parity?

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

    great work! one of the best and "easy to follow" tuts regarding dynamic forms... many thx!

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

    Thank You, Very Much, Joshua. This is exactly what I needed instruction on.

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

    i remember doing something like this in a project, it had columns support, something like this [{control}, {control}] it even had selects with server-side options using the async pipe and dynamic formgrups.

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

    Thanks.. Nice video Joshua.. really useful. Could you please upload 1 more video for formArray with events bindings from JSON file configuration ?

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

    Thank you, today less time spent :)

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

    Wonderful and very useful. Good work.

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

    Just one small help. Given that the HTML is built dynamically, is it possible to control the actual layout? For example first and last name in one row, then email in row 2 etc etc. Given that the Json form data could have anything, how can we control display. The reason behind my question is I want to create a single presentation component for my detail forms which could receive any json array. Is there a way to do this?
    Also if there is a drop down which needs server data, how can that be accomplished in this design?

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

    Any tips on linking controls? eg if selecting some options in a multi-select needs to drive a selection in another control, or limits what data is available in the second control

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

    Very interesting, thank you!

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

    10:37 Do we really need to explicitly set the value for any of the inputs in the template ? I think it would only make sense to specify value for options in select if we had one.

  • @prathameshkoyande8984
    @prathameshkoyande8984 9 дней назад

    How to persist the changes made in the form

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

    How would you cater for forms that have nested form groups?

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

    Excellent

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

    Have you tried to combine this approach with typed forms?

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

    Nice, I am working on a form builder, this would be of great help, thanks!. One question, what is the advantage of this approach over the angular dynamic forms?

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

      Are you referring to an npm package? No particular advantage/disadvantage to this approach over using a 3rd party library, just depends on what you want/what you're trying to do/preferences etc. I tend to prefer rolling my own solutions if it's simple enough rather than introducing new dependencies into the project.

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

    Hi Joshua, may you (or anybody else) give us a hint how we can pass the value type of control from a JSON (string variable) as a generic param of a typed FormControl (Typed forms introduced in A14). Thanks in advance.

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

    thank you ! :)

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

    How would you extend this to include questionnaire data (also stored in a JSON file) where nested one-to-many data exist in the JSON, i.e, an array and a FormArray would be needed in the typescript ?

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

    nice tutorial,
    what if i want to add selection on form?

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

    Amazing

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

    what if there is a formArray. please cover it.

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

    Excellent video. I am building a similar app @ work for determining product offering based on suitability. Since we have a few products to offer, the JSON structure needs to reflect a decision tree with leaf nodes as the products. While I can use your approach to store questions in JSON, the missing functionality is - How do I render a set of questions based on the answers to one or more questions?

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

    Can i pass events dynamically in JsonDataForm and how to call them?

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

    Thanks Joshua, geat video.
    How would go about adding fieldsets dynamically into the layout, so you can create accessible sections throughout the form?

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

    How do I style my form to look the same without using ionic ?

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

    I'm having with the Json file. I'm making a different file for my project, but when I try to put the file path of the json into my component for the form, it says my json file can't be found even though its in the project folder. I've been trying to do multiple file paths, but they all give the error. I'm so stuck and confused that it's frustrating.

  • @SA-ie6lr
    @SA-ie6lr 2 года назад +1

    I tried it in angular in this way

    but it is not working...May I know the reason or any solution for this problem.

    • @Danny-er1sf
      @Danny-er1sf Год назад

      Your using angular material ! I think, if u try without mat ..u will get it right ! Cheers if it helps

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

    Hi @Josgua
    Your video really helped me a lot, thank you.
    I just have a question about how the push works when it is min and max I see that you only use it in a Button radio, but you access and do not use validators and I do not understand how to use them because currently the form returns true in a number type input, I hope you can help me can you help.

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

    @Joshua Morony. If I use ngOnChanges, "Property 'pluginConfigs' comes from an index signature, so it must be accessed with ['pluginConfigs']". Could you kindly let me know what could be the reason, and I do not have a Input variable, I am having an object for my JsonData. Kindly let me know. it would be very helpful. Thank you

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

      Could you kindly let me know the best way to reach you personally? Thank you.

  • @JohnnyChauque-d7g
    @JohnnyChauque-d7g Год назад

    With the Dynamic form being loaded from the JSON, how are we going to handle the dropdown(Values), I mean population data into the dropdown and other thing is the conditional forms

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

      You can define a `type: select` in your JSON FORM, pass in a key-value pair options like this`options: [{key: string, value: string}]`, then use to loop through your options. Obviously this input field would be condtional. (That is, *ngIf = control.type === 'select)'. I hope this helps.

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

    Hi Josh amazing video was super helpfull. I am creating an application where I want to generate each page dynamically from a single json that specifies the elements that each view must have. And from this, generate that view with the specific data needed for each one. What is the most optimal way to do this in Angular?

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

    Hello, everything is working fine until I render form inputs dynamically in the template. I get a bunch of errors.
    mainly:
    Property formGroup is not provided by any applicable directives nor by form element
    Event ngSubmit is not emitted by any applicable directives nor by form element
    No directive is matched on attribute ngFor/ngIf
    and so on... Maybe you've got a solution? I need to hand in an app for university and I am kind of lost ...

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

    Hi I'm following your videos. Please provide the video or guide need multiple dynamic form from josn. If click add button create form and update in json also. Please guide.

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

    Great but it is really hard to find generating deeper nested reactive forms.

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

    I going to try to replicate it in stencil/web components. thanks

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

    Te amo papu!

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

    how to use material instead of ionic

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

    Hey mate ... this looks fantastic :-) Would it be valid to make this into a service to be used in any page/feature you want ie so the form controls json could be sourced from an api call, maybe with a fallback to a local json file? And maybe extended so you can specify which forms control file/data you want at the time of use? Would love to see how this could be accomplished ;-)

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

      Hey Scott, there's no reason specifically that you would need to add a service here. The custom component in the video already supports passing in the JSON form data as an input, so you could grab that data however you wanted (locally or from an API) and pass it into the component. And you could certainly also add more inputs to the component if you wanted to allow more fine grained control over things.

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

      @@JoshuaMorony thanks Josh that makes sense. Will give it a go today :-)

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

    This Reactive form Wrapper component is amazing but what if this controls have child and grandchild forgroups & formarrays 😢

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

    I wonder how they do the job of creating forms for thousands of products with various features on e-commerce sites like aliexpress or amazon. Are they using something like this?