Advertisement
Guest User

ember

a guest
Apr 17th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //routes/search.js
  2. import Ember from 'ember';
  3.  
  4. export default Ember.Route.extend({
  5.     model: function(params) {
  6.         var Store = this.store;
  7.         var foundInDescription = Store.find('note').then(function(links) {
  8.             return Store.filter('note', function (note) {
  9.                 return note.get('description').indexOf(params.search_for) >= 0;
  10.             });
  11.         });
  12.         return Ember.RSVP.hash({
  13.             foundInDescription: foundInDescription,
  14.         });
  15.     }
  16.  
  17. //search.hbs
  18. ...
  19. {{#each noteItem in model.foundInDescription itemController="note"}}
  20. ...
  21.    
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement