Created
June 15, 2016 05:04
-
-
Save prudvi/fc3e3e85c1a25fea6865d36822c45864 to your computer and use it in GitHub Desktop.
even-odd items
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
numbers: [], | |
evenItems: Ember.computed('numbers.[]', function() { | |
return this.get('numbers').filter(function(num){ return num.value % 2 === 0 }) | |
}), | |
oddItems: Ember.computed('numbers.[]', function(number) { | |
return this.get('numbers').filter(function(num){ return num.value % 2 !== 0 ;}) | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
var numbers = [ | |
{value: 1, title: 'raju'}, | |
{value: 10, title: 'B'}, | |
{value: 12, title: 'A'}, | |
{value: 11, title: 'NNN'}, | |
{value: 16, title: 'RRKS'}, | |
{value: 19, title: 'MCVDF'}, | |
{value: 21, title: 'MVSDG'}, | |
{value: 51, title: 'TUDFB'}, | |
{value: 54, title: 'FBDFGH'}, | |
{value: 126, title: 'UER'}, | |
] | |
export default Ember.Route.extend({ | |
model() { | |
return numbers; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.9.1", | |
"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.6.0", | |
"ember-data": "2.6.0", | |
"ember-template-compiler": "2.6.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment