Forked from mudassir0909/ember_unknown_property_hook.js
Last active
August 29, 2015 14:17
-
-
Save hernan/5bba9e1716482fc180db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Little background about unknown properties | |
| myObject = Ember.Object.create({name: 'hi'}) # a plain simple ember object | |
| # so the property "name" is a known property for myObject, but any other properties which are not defined on this object are unknown properties | |
| myObject.get("age") # age is an unknown property as we did not set "age" yet, the expression on the left evaluates to undefined | |
| # Be careful ! only properties on the object that are not "set" yet are unknown properties but not the properties that evaluate to null/undefined | |
| myObject.set("status", undefined) # although myObject.get("status") evaulates to undefined, status is a known property for myObject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment