Especially for nested variables I find I’m constantly just trying all the different combinations of stringing variables together with and without .get.
I’ve been messing with how to access my model instance from a view. For example say Im adding a variable to my controller…
…or is startDate: this.get(‘parentView’).get(‘controller’).get(‘model’).get(‘createdAt’)
…or maybe startDate: parentView.controller.get(‘model’).get(‘createdAt’)
or even… startDate: this.get(‘parentView.controller.model.createdAt’)
I feel like im always messing with adding and removing .get to attempt to get my variables working and I realise I really have no idea when to use which and when I must use .get and when I should not be using it.
My example is contrived from what I’ve been fiddling with recently and probably doesn’t represent good code, but I just wanted to show how the .get is causing me confusion and see if we can gather a clear guideline of when to use it and when not to.