0

how can I validate an email in vueJs + firebase?

for example I have data array email: ['badi@gmail.com','badEmail.com','realEmail.com']

and I usually validate it in vueJs+firebase like this

 computed: { 
 validation: function () {
  return {
    email: !!this.categoryTest.email.trim(),

  } 
},
isValid: function () {
  var validation = this.validation
  return Object.keys(validation).every(function (key) {
    return validation[key]
  })
},
}

but for checking array I'm still confused.. thanks

Yerko Palma
  • 12,041
  • 5
  • 33
  • 57
badruz
  • 1
  • 5
  • Explain what your code should do, and what happens instead of it working please. – Matt C Mar 24 '16 at 03:01
  • @Matthew Cliatt thanks, I have try following http://vuejs.org/examples/firebase.html but how I can validate email if in array for ex :['badi@gmail.com','badEmail.com','realEmail.com'] – badruz Mar 24 '16 at 03:09
  • Did you look at the [examples in the API doc](https://www.firebase.com/docs/security/api/string/matches.html), which show both how to validate an email and the reasons you probably shouldn't be doing this? – Kato Mar 24 '16 at 16:09
  • Possible duplicate of [Validate email address in JavaScript?](http://stackoverflow.com/questions/46155/validate-email-address-in-javascript) – nu everest Mar 18 '17 at 23:46
  • There is nothing special about VueJS and Firebase. You just need to use standard javascript. See this http://stackoverflow.com/questions/46155/validate-email-address-in-javascript – nu everest Mar 18 '17 at 23:47

0 Answers0