I was wondering how, on some kind of event, could you import into the dom say a component. ie if you have a form with an email and password, and validation for the form, how could you into the email div enter an {{error-component message=message}}, where the message would be "Not a valid email", and into the password div (or td) enter the same component, with a different message.
Algorithm for explanation:
onSubmit(){ validateForm: if email not valid { importComponent('#emailDiv', "Email not valid") } if password not valid { importComponent('#passDiv', "Password does not have enough characters") } }
Aucun commentaire:
Enregistrer un commentaire