0

I have an element that has a type property.

class Element {
   private id: string;
   private type: string;
   private properties: Map<string, any>;
}

the element can have different properties based on type.

I need to create a different form (any type has different fields) on a single edit page.

My idea is to create a different form component per type and load it, into edit page, based on a route parameter "type".

the route can be "/elements/:type/:id/edit"

How can I implement this behavior?

theShadow89
  • 1,307
  • 20
  • 44
  • You can use a similar approach to https://stackoverflow.com/questions/36325212/angular-2-dynamic-tabs-with-user-click-chosen-components/36325468#36325468 – Günter Zöchbauer Oct 19 '17 at 14:02
  • what have you tried so far? the angular docs go into depth on dynamic forms and dynamic components both. – bryan60 Oct 19 '17 at 14:02

0 Answers0