dot notation vs Ember.get behavior shift in Ember 3.2 from Ember 3.1.1
See original GitHub issueThis issue manifests in Ember 3.2 but not Ember 3.1.1
Imagine you have an instance of an Ember.Object
(maybe a service
), and on this instance you have an instance of another Ember.Object
(perhaps a model
), and this model has a property.
If model
is isDestroyed: true
, then the following occurs regardless of the value of property (e.g. it could be a computed, an ES getter, a simple boolean), the following behavior divergence below is observed.
service.get('model.prop'); // undefined
service.model.prop; // a value
Additionally, if prop
has dependent keys, then the first call will error that you cannot set dependent keys, while subsequent calls will work.
service.model.prop; // throws error
service.model.prop; // a value
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Ember 3.1 and 3.2 Beta Released
Today the Ember project is releasing version 3.1.0 of Ember.js, Ember Data, and Ember CLI. This release kicks off the 3.2 beta cycle...
Read more >Should I chain `get()`s in Ember, or can I use dot notation?
Can not remember where I read it on the ember site but they suggested the best solution was the dot notation. this.get('controller.
Read more >ELI5 Full Stack Basics: breakthrough with Django & EmberJS
It represents a shift in my thinking as I take steps towards more complex full stack development. It also serves as an entry...
Read more >@ember-data/store | Yarn - Package Manager
The core of EmberData. Provides the Store service which coordinates the cache with the network and presentation layers. ember-addon. readme. EmberData.
Read more >Build An Ember.js App In 2019 For Beginners ! - YouTube
In this video I discuss how to setup an app for beginners with Ember.js Octane (the latest version of Ember.js). In this tutorial...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s still valid case 😕
Parts of it are definitely still valid, though I don’t know that we are likely to change much fundamentally here.
I suspect the underlying issue is that once destroyed we won’t actually compute computeds, we will generally only return a previously cached value (if it had been retrieved before).