guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema
MIT License
485 stars 174 forks source link

Bind visibility after creation to prevent multiple calls #454

Closed KBroichhausen closed 1 year ago

KBroichhausen commented 1 year ago

First create the elements and then create initial bind of visibility by calling _bindVisibility just for the root element.

If you have many nested objects, this is a lot faster because each PropertyGroup does not call _bindVisibility at creation. Previously, it was called for each one at creation but eventually it will get called anyways because root element is a PropertyGroup which calls _bindVisibility of childs (and therefore for child PropertyGroups).