Re:Ember.js is driving me crazy
by ufo on Tuesday January 28, 2014 @12:53PM
(#7138525)
Can anyone who is more experienced with ember help explain what was going on in those two weird examples in the OP? (Commenting a widget affecting another one and setting the "bar" field also changing the value of "foo" field)
[ Parent
| on HN ]
In the first case, he was using an `ObjectController` without understanding the special behavior of the `model`/`content` property.
In the second case, he used HTML comments to comment out Handlebars code, not realizing that he should have used Handlebars comments.
Re:Ember.js is driving me crazy
by mightybyte on Tuesday January 28, 2014 @05:13PM
(#7140162)
To be fair, the documentation I was linked to doesn't say anything about the 'content' property behaving this way. It only mentions 'model'.
In the second case, it seems quite reasonable to assume it knows about HTML comments and that they would behave as I expect.
Re:Ember.js is driving me crazy
by adamferguson on Tuesday January 28, 2014 @06:05PM
(#7140488)
The docs for ObjectController (and ObjectProxy, which ObjectController extends) both mention the specific behavior about 'content' (not model, the fact that model and content mean the same thing when you're talking about proxying controllers is something you learn as you go along):
http://emberjs.com/api/classes/Ember.ObjectController.html http://emberjs.com/api/classes/Ember.ObjectProxy.html
Sorry to hear about the pain points so far. I felt like this many times when I was starting with Ember. It definitely gets better the more you become familiar with all the different conventions.