vendredi 27 juin 2014

Model validation message

I have a separate config singleton that I require first (this is the first item in my requires array) in app.js. I'd like to use a validation message inside of my models that will be pulled from this config file something like this:

Code:



validations: [
{
type: 'presence',
field: 'title',
message: Myapp.myconfig.getMesssages().mymessage
}
],

I was wondering whether I'm guaranteed to have Myapp.myconfig.getMesssages().mymessage ready at this time? Help is much appreciated! Thanks!


Aucun commentaire:

Enregistrer un commentaire