Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //routes/search.js
- import Ember from 'ember';
- export default Ember.Route.extend({
- model: function(params) {
- var Store = this.store;
- var foundInDescription = Store.find('note').then(function(links) {
- return Store.filter('note', function (note) {
- return note.get('description').indexOf(params.search_for) >= 0;
- });
- });
- return Ember.RSVP.hash({
- foundInDescription: foundInDescription,
- });
- }
- //search.hbs
- ...
- {{#each noteItem in model.foundInDescription itemController="note"}}
- ...
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement