Skip to content

Instantly share code, notes, and snippets.

@3gwebtrain
Last active February 18, 2018 10:43
Show Gist options
  • Save 3gwebtrain/59280ed28b9293c8f34e8f9a91b41559 to your computer and use it in GitHub Desktop.
Save 3gwebtrain/59280ed28b9293c8f34e8f9a91b41559 to your computer and use it in GitHub Desktop.
Dynamic Calss
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
class:'myclass',
actions:{
setting:function(element, index){
console.log(element, index);
}
}
});
import Ember from 'ember';
export default Ember.Route.extend({
model(){
return ['rose','liliy','lotus']
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
<ul>
{{#each model as |flower index|}}
<li class="(action 'setting()')">{{flower}}</li>
{{/each}}
</ul>
<br>
<br>
{
"version": "0.13.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment