I'm working on an Angular 4 application with Bootstrap 4.
I have implemented a bootstrap modal component which works fine. On click it shows and clicking on cross closes it.
The modal contain a form to add a user.
And on clicking on Add User button adds the user properly.
All I want is to close the modal if users added success fully.
I used onSubmit()
function in Angular component:
onSubmit({value, valid}) {
if (valid) {
console.log(value);
this.formInvalid = false;
this.userMeta = value;
this.allUsers.unshift(this.userMeta);
} else {
console.log('Form is invalid!', valid);
this.formInvalid = true;
}
}
So is there any way I can close the modal in this function?