From edbc95891915338e3e0df1cdfdebfccb82341cab Mon Sep 17 00:00:00 2001 From: Kevin McGee Date: Sun, 27 Jul 2014 23:46:36 -0700 Subject: [PATCH] Update the-ember-object.md Proposed an amplification of use of Get, to include Set and an explanation as to why these are the preferred accessors. Caught of typo regarding capitalization. In this entire peice, it is always "Ember", not "ember" I would say. --- chapters/the-ember-object.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chapters/the-ember-object.md b/chapters/the-ember-object.md index d549659..1c7410d 100644 --- a/chapters/the-ember-object.md +++ b/chapters/the-ember-object.md @@ -45,6 +45,10 @@ user.get('firstName') == 'Sam' //=> true user.get('lastName') == 'Smith' //=> true ``` +\\Consideration\\ +It might be worthwhile to explain the use of 'set' to write object property values, AND, explain why use of 'get' and 'set' +is crucial, as opposed to POJO dot-notation to access object properties. + Inquire about the object with `.toString()`. In this case we see that it's just Ember.Object. ```coffee @@ -277,7 +281,7 @@ Extending objects is a pattern you will use all the time while developing in Emb ## Init -All ember objects call an `init` function when they are first initialized. You can use this to do setup work. +All Ember objects call an `init` function when they are first initialized. You can use this to do setup work. ```coffee App.Human = Ember.Object.extend