You have let-d or let-c in as variables, both are functions. So, the simple way to do it is: pass in c or d into submit as argument like this (click)="submit(c)" or (click)="submit(d)" and then in the function just call submit(c){ c('close modal'); }. Hope that works for you.