Use the NgActiveModal method to close it on a click by adding a specific modalActive object and use it on download function. See issue: Chocobozzz#1436