I fetched the checkboxes names from database, put them in array so they look like this:
pets = ['dog', 'hamster', 'cat', 'parrot']
Then I display them on my view in the following manner:
<div *ngFor='let pet of pets'>
<input type='checkbox'
name='pets'
value='{{pet}}'
/>
{{pet}}
</div>
So now the question is how can I collect only checked values so that I can send those to the server?