jeudi 2 mai 2019

Unable to clear checkbox on same component navigation in Angular 7

I have a filter with checkboxes. The IDs of the elements in the checkbox are stored in an array called activeCheckboxes. I am checking them on ngOnInit(), from what I am getting from query params.

To get the things checked, getting from the query params, I am using this attribute:

 [checked]="activeLocation.indexOf('location._id')>-1" 

Now, when I am resetting the filter, I am simply navigating to the same component with entirely different query-params / no query-params at all. It is working fine. However, the checkboxes are still checked. I have cleared the 'activeCheckboxes' array before navigating. Still, the same is happening.

Any clue how to solve this?




Aucun commentaire:

Enregistrer un commentaire