Skip to content

Instantly share code, notes, and snippets.

@bjc
Created October 5, 2008 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjc/14837 to your computer and use it in GitHub Desktop.
Save bjc/14837 to your computer and use it in GitHub Desktop.
"Support observing non-content properties": function () {
this.c.fireCount = 0;
this.c.nonContentObserver = function () {
this.set('fireCount', this.get('fireCount') + 1);
}.observes('nonContentProp');
// Fire the observer with the first set.
this.c.set('content', SC.Object.create());
this.c.set('nonContentProp', 'test');
this.c.get('fireCount').shouldEqual(1);
delete this.c.fireCount;
delete this.c.nonContentProp;
delete this.c.nonContentObserver;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment