title: Angular2/4 app to display forms based on JSON data using ngFor and ngIf only. Could it work?
body: <p>I have to build an Angular application that has a single task: It receives JSON data that describe a form structure, e.g.:</p>
  
  <pre><code>{
    "textbox": {
      "type": "string",
      "name": "name",
      "maxlength": 30,
      "description": "Full Name"
    },
    "textbox": {
      "type": "string",
      "name": "email",
      "maxlength": 40,
      "description": "Email"
    },
    "date": {
      "name": "birthdate",
      "description": "Birthdate"
    },
    "checkbox": {
      "name": "subscribe",
      "options": [
        "Yes",
        "No"
      ],
      "default": "No",
      "description": "Subscribe?"
    },
    "button": {
      "type": "submit",
      "description": "Send"
    }
  }
  </code></pre>
  
  <p>And it should display it: (All forms are different with varying elements.)</p>
  
  <p><a href="https://i.stack.imgur.com/q4oAM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q4oAM.png" alt="form preview"></a></p>
  
  <p>I'm relatively new to Angular and my initial approach would be to create a simple template that has an ngFor in it, and inside many ngIfs (one for text fileds, one for text area, another for radio button, and so on...) that examine for the "type" of the given form element, and if there is a match, it gets displayed with its attributes written in the JSON.</p>
  
  <p>Is it a good idea to start like this, or should I first learn some more Angular to be able to come up with a more professional solution?</p>
  
  <p>Are things like dynamic and reactive forms in Angular for this purpose, or which part of Angular should I have a deeper understanding in for this task?</p>