I have a hardcoded checkbox that looks like this:
https://i.sstatic.net/UVVCM.png
The code snippet is as follows:
<h5>Document List</h5>
<div class="form-check">
<label class="form-check-label" for="check1">
<input type="checkbox" class="form-check-input" id="check1" name="proformaInvoice" value="something" [(ngModel)]="processAnexOne.proformaInvoice" value="checked" >Proforma Invoice
</label>
</div>
The JSON data being received can be viewed here:
https://i.sstatic.net/ckeWq.png
To fetch the JSON data from an API, I use this method:
ngOnInit() {
this.http.get('http://localhost:8080/api/documents')
.subscribe((data: any[]) => {
this.documents = data;
console.log(this.documents);
})
}
Is there a way to dynamically bind this JSON data to the checkbox?