Last active
October 13, 2016 03:19
-
-
Save kumkanillam/66477278e5e06bf328dd7aaaa8cc7bb6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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', | |
filterText:'too', | |
filterdText: Ember.computed('filterText',function(){ | |
var filter = this.get('filterText').toLowerCase(); | |
return this.get('model').filter((item,index) =>{ | |
for(var key in item){ | |
if( item.hasOwnProperty(key)){ | |
console.log('OwnProperty Key-',key); | |
if(item[key].toLowerCase().indexOf(filter) !== -1){ | |
return true | |
} | |
} else { | |
console.log('Inherited Property Key-',key); | |
} | |
} | |
return false; | |
}) | |
}) | |
}); |
This file contains hidden or 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.Route.extend({ | |
test: [ | |
{ | |
"source": "this is a source", | |
"title": "this is a title", | |
"message":"this is a message" | |
}, | |
{ | |
"source": "this is a source too", | |
"title": "this is a title too", | |
"message":"this is a message took" | |
} | |
], | |
model(){ | |
return this.get('test'); | |
} | |
}); |
This file contains hidden or 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.10.5", | |
"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.8.0", | |
"ember-data": "2.8.0", | |
"ember-template-compiler": "2.8.0", | |
"ember-testing": "2.8.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment