5 ms·
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 a
by ufo 13y ago
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)
- tomdale 13y agoIn this case, the author didn't actually comment out the code; he left it in place, assuming it would not affect the app when in fact it did.
- rxcfc 13y agoIn 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.
- mightybyte 13y agoTo 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.
- adamferguson 13y agoThe 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.ObjectController.html http://emberjs.com/api/classes/Ember.ObjectProxy.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.