Infinite callback of an observe when is called


The issue I am running into is that when observing on an ObjectController, after calling model.saveI() an observe is getting triggered infinitely because is triggering an update of the property I am observing.

App.IndexController = Ember.ObjectController.extend({
  // this gets triggered by
  search: function() {    
    // this triggers the observes('name') inf'member');
  actions: {
    save: function() {

Any ideas about how to avoid this? Thanks!

Here is a jsbin showing the issue with some debugging to showcase the issue:


So the solution I’m thinking is either:

  1. calling this.set('model', null); before saving the model
  2. in the search function, return unless mode.isNew

here’s a jsbin with the 2nd solution: