vendredi 1 juillet 2016

ember nested model ember-cp-validation

Hello I'm trying to validate a nested model in Ember with ember-cp-validation. It work's fine on the main model but I can't find out a way to link my nested model into the inout helper and so the validations don't work Model:

export default Model.extend(Validations, {
'_id': attr('number'),
'name': attr('string'),
'cookType': attr(),
'pictures': attr(),
'comments': attr(),
'url': attr('string'),
'address': belongsTo('address', {async: false}),
'createdAt': attr('date'),
'updateAt': attr('date'),
'cuisine': Ember.computed(function() {
    return `${this.get('cookType')}`;
})
});

My Nested model :

export default Model.extend(Validations, {
street:attr('string'),
number:attr('number'),
zip:attr('number'),
town:attr('string'),
country:attr('string')
});

My template call :

<div class="form-group">
        Rue :  
       
            
        

        <div class="input-error">
            
            <div class="error">
                
            </div>
            
        </div>
    </div>

Thanks for your help




Aucun commentaire:

Enregistrer un commentaire