Should I use:
this.get('controller').get('simpleSearch').get('selectedOptions').get('height')
or
this.get('controller.simpleSearch.selectedOptions.height')
I think the first is ... verbose. Is there a reason not to use the second method?
I don’t remember where I read it on the ember website, but they suggested that the point solution was the best solution.
Looking for an answer, I found this topic: The Ultimate Guide to Using .get at discuss.emberjs.com .
According to gordon_kristan answer :
Always use get () and use it in one of the following two ways:// If obj is guaranteed to not be null or undefined obj.get('very.deep.nested.property'); // If obj might be null or undefined, or if it not an Ember object, Ember.get(obj, 'very.deep.nested.property'); get() - Ember . , , PromiseObject ( Ember-Data ):// This will not work, since it won't activate the `unknownProperty` handler on `model` var startDate = parentView.controller.model.createdAt; // But this will work var startDate = Ember.get(parentView, 'controller.model.createdAt');
Always use get () and use it in one of the following two ways:
// If obj is guaranteed to not be null or undefined obj.get('very.deep.nested.property'); // If obj might be null or undefined, or if it not an Ember object, Ember.get(obj, 'very.deep.nested.property');
get() - Ember . , , PromiseObject ( Ember-Data ):
// This will not work, since it won't activate the `unknownProperty` handler on `model` var startDate = parentView.controller.model.createdAt; // But this will work var startDate = Ember.get(parentView, 'controller.model.createdAt');
, christopher :
obj.get('very.deeply.nested.property') undefined , obj - undefined. - undefined, get() undefined. get() , , - undefined.
obj.get('very.deeply.nested.property')
obj
undefined
get()
, ember-metal/lib/property_get.
Source: https://habr.com/ru/post/1529113/More articles:Make jar run in 32bit jre - javaPrevious Java elements in ArrayList / List are replaced when the next element changes - javaMacOS code signing in JDK7 bundle on Mavericks 10.9.1 - javaManaging Firefox Extension via Javascript - javascriptДоступ к SDK-модулю надстройки из блокнота - firefoxSorting arrays of objects using compareTo () - javaАлгоритм "распространения" уменьшающего значения на трехмерном массиве - arraysPreventing the next handler / callback call - javascriptselenium webdriver.Firefox not starting for user not using sudo - pythonError connecting to Orient DB database via JDBC drivers - javaAll Articles