angular2-json-schema-form change add button text of type="array"

753 Views Asked by At

I'm using https://github.com/dschnelldavis/angular2-json-schema-form/ in my angular 4 project which refers to the http://schemaform.io/ for angular js. I have a JSON scheme which contains several objects of type="array". The lib adds a button to add more objects to the array. The default title is "Add to {object name}".

My question is how can I change the title of the button because the description should be in German. Thank you very much.

1

There are 1 best solutions below

0
Chanandler Bong On

Extend the default Array Widget as described here.

You will need to copy the original template and replace the English button descriptions with German ones:

<button (click)="removeItem(i)" class="btn btn-default array-remove-button">
    <span class="glyphicon glyphicon-minus" aria-hidden="true"></span> ---> Remove <---
</button>
</div>
<button (click)="addItem()" class="btn btn-default array-add-button">
    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> ---> Add <---
</button>