File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
packages/@ember/-internals/glimmer/lib/helpers Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 33*/
44
55/**
6- Dynamically look up a property on an object. The second argument to `{{get}}`
7- should have a string value, although it can be bound.
6+ Dynamically look up a property on an object or an element in an array.
7+ The second argument to `{{get}}` should have a string or number value,
8+ although it can be bound.
89
910 For example, these two usages are equivalent:
1011
7778 Would allow the user to swap what fact is being displayed, and also edit
7879 that fact via a two-way mutable binding.
7980
81+ The `{{get}}` helper can also be used for array element access via index.
82+ This would display the value of the first element in the array `this.names`:
83+
84+ ```handlebars
85+ {{get this.names 0}}
86+ ```
87+
88+ Array element access also works with a dynamic second argument:
89+
90+ ```handlebars
91+ {{get this.names @index }}
92+ ```
93+
8094 @public
8195 @method get
8296 @for Ember.Templates.helpers
You can’t perform that action at this time.
0 commit comments