function submit() {
if (!$errors) {
const controller = alertController
.create({
header: 'Account Created',
message: `Created account for: <b>${$form.firstName} ${$form.firstName}</b>`,
buttons: [
{
text: 'OK'
}
]
})
.then((alert) => alert.present());
}
if ($errors) {
const controller = alertController
.create({
header: 'Account Not Created',
message: `There were some errors - see console.log`,
buttons: [
{
text: 'OK'
}
]
})
.then((alert) => alert.present());
}
}
How to reproduce
Problem
The code for Input/+page.svelte is supposed to show an alert, but this is in a
submit()function that never gets called: