# Update component when schema is extended - Angular

**URL:** <https://jsonforms.discourse.group/t/update-component-when-schema-is-extended-angular/1506>\
**Category:** General\
**Created:** [May 31, 2023, 2:09pm UTC](https://jsonforms.discourse.group/t/update-component-when-schema-is-extended-angular/1506 "2023-05-31T14:09:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haigos](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/haigos/32/724_2.png) [@Haigos](https://jsonforms.discourse.group/u/Haigos)\
**Post date:** [May 31, 2023, 2:09pm UTC](https://jsonforms.discourse.group/t/update-component-when-schema-is-extended-angular/1506/1 "2023-05-31T14:09:57Z")

</div>

Hi,

How would I go about making sure the generated form is updated if I externally add to the schema (adding another property of type string for example) without a full page reload and local storage shenanigans?

I currently have a wrapper component around the jsonforms component, into which the schema is passed as a behavior-subject. My idea is to init the JsonFormsAngularService in the wrapper component with the initial data, schema and UiSchema. Then, whenever the schema changes, to use the service to update the schema and refresh the component with the service’s refresh() method.

At the moment I can get the state to change (it contains new properties I’m adding), but the generated form does not change.

I’m curious if my approach is somewhat admissible, and if so, what am I missing?

If there is an easier way I’m also all ears!

Thanks!

---

<div class="post-metadata">

**Author:** ![Haigos](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/haigos/32/724_2.png) [@Haigos](https://jsonforms.discourse.group/u/Haigos)\
**Post date:** [June 1, 2023, 12:34pm UTC](https://jsonforms.discourse.group/t/update-component-when-schema-is-extended-angular/1506/2 "2023-06-01T12:34:50Z")

</div>

```
          Object.assign() fixed the issue, making sure the same reference is kept.

```

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [June 12, 2023, 3:36pm UTC](https://jsonforms.discourse.group/t/update-component-when-schema-is-extended-angular/1506/3 "2023-06-12T15:36:39Z")

</div>

Hi @Haigos,

Nice that you were able to solve your issue. Let us know when you have further problems 🙂
