Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dismiss(data?: any) {
// Using the injected ModalController this page
// can "dismiss" itself and pass back data.
// console.log('dismiss', data);
if (this.navParams.data.option === 'add') {
this.store.dispatch([
new UpdateFormValue({
value: data,
path: 'catalog.movieForm'
}),
new UpdateFormStatus({
status: 'PENDING',
path: 'catalog.movieForm'
})
]);
}
this.modalCtrl.dismiss(data);
}
clearMovieForm() {
console.log('clearMovieForm');
this.movieForm.reset();
this.store.dispatch([
new UpdateFormValue({
value: this.emptyMovie,
path: 'catalog.movieForm'
}),
new UpdateFormStatus({
status: '',
path: 'catalog.movieForm'
})
]);
}
clearForm(path: string, value: any) {
this.store.dispatch(new UpdateFormValue({ value, path }));
this.store.dispatch(new UpdateFormDirty({ dirty: false, path }));
}
}
setValue(val) {
this.store.dispatch(
new UpdateFormValue({
value: {toppings: val, crust: 'thin'},
path: 'todos.pizza'
})
);
}