I want to display error message from server when record is not find
my model is
model: function(userLoginToken) {
var userLoginToken= this.store.createRecord('userLoginToken');
return userLoginToken;
},
when I clicked on the action
actions: {
sendOTP: function(userLoginToken) {
var thisObject = this;
var model=this.currentModel;
this.store.findRecord('user-login-token', userLoginToken.get('mobileNumber')).then(
function(response) {
//thisObject.get('controller').set('model', response);
},
function(error) {
//thisObject.get('controller').set('model', error);
//alert("model======== "+model.get('errors'));
}
);
},
MY template is not displaying error message
I am displaying error message in my template
{{#each model.errors.messages as |message|}}
<div class="errors">
{{message}}
</div>
{{/each}}
How to display error message in case when record is not found.
Aucun commentaire:
Enregistrer un commentaire