Skip to content

Instantly share code, notes, and snippets.

@nightire
Created March 4, 2020 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nightire/936c3857f7fd200dc273c6023d07be68 to your computer and use it in GitHub Desktop.
Save nightire/936c3857f7fd200dc273c6023d07be68 to your computer and use it in GitHub Desktop.
example to use each-in
import Controller from '@ember/controller';
class ApplicationController extends Controller {
abvalues = [
{a:{title:"First A"},b:{title:"First B"}},
{a:{title:"Second A"},b:{title:"Second B"}},
]
}
export default ApplicationController;
{{#each this.abvalues as |abvalue|}}
<div>
{{#each-in abvalue as |key value|}}
<strong>{{value.title}}</strong>
{{/each-in}}
</div>
{{/each}}
{
"version": "0.16.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.14.3",
"ember-template-compiler": "3.14.3",
"ember-testing": "3.14.3"
},
"addons": {
"ember-data": "3.14.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment