I suspect this is a very simple question that I'm just struggling with as I'm pretty new to this. I appreciate any help, or just pointing in the right direction.
I have a button that upon clicking it, I want it to execute multiple functions that I have written in the same ts file. The onClick() is working as if I put console.log statements in it, those will run. However calls to other functions do not.
Relevant code below should clarify my question:
HTML:
<button type="submit"
class="btn btn-success"
(click)="onSaveChanges()">
Save Changes
</button>
TS:
private populateToDeleteArray = () => {
this.groupsToDelete = this.originalUserAssociatedGroups
.filter(i1 => !this.pickListUserAssociatedGroups
.some(i2 => i1.id === i2.id));
}
private populateToPostArray = () => {
this.groupsToPost = this.pickListUserAssociatedGroups
.filter(i1 => !this.originalUserAssociatedGroups
.some(i2 => i1.id === i2.id));
}
The other two functions are defined in a similar manner... Then the onClick():
onSaveChanges = () => {
console.log('Huh?');
this.populateToDeleteArray();
this.populateToPostArray();
this.sendDeleteRequests();
this.sendPostRequests();
}
And as said above, the console.log runs, but the other functions are not called. I'm rather confused.
Thank you in advance!