lundi 10 avril 2017

"Attempted to handle event `reloadRecord` on

I tried searching for same kind off issue if asked already but couldn't find exactly. My problem is:-

I'm calling a function from a .handlebars class with the required parameters but while it is calling the function, at one pint where it's calling reload() function, it throws exception.

The code snippet is like:-

  saveBookmark: function saveBookmark(name, value, version) {
    var self = this;
    this.get('user').reload().then(function () {
      var bookmarks = self.get('bookmarks') || [];
      var newBookmarkId = bookmarks.sortBy('id').getWithDefault('lastObject.id', 0) + 1;
      var date = moment().format('YYYY-MM-DD');
      bookmarks.push({ key: self.get('key'), version: version, id: newBookmarkId, name: name, value: value, date: date });
      self.set('bookmarks', bookmarks);
      self.send('savePreferences');
    });
  },

So, the exact line where it;s throwing error is:-

this.get('user').reload()

However, on browser console, I can find the value of

this.get('user')

Firther, I can not make changes to this function as this is generic and is being used aross several places and working fine.

If you could provide me some idea of occurrence of this issue to resolve would be of much help.

PS:- I'm new to Ember.js.




Aucun commentaire:

Enregistrer un commentaire