Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Ember from 'ember';
  2.  
  3. export default Ember.Route.extend({
  4.     model: function() {
  5.     return Ember.RSVP.hash({
  6.       transactions: this.store.find('transaction'),
  7.       runResults: this.store.find('run-result'),
  8.       runTypes: this.store.find('run-type'),
  9.       transactionResults: this.store.find('transaction-result').then(function(transactionResults) {
  10.         var transactions = transactionResults.getEach('transaction');
  11.         var runResults = transactionResults.getEach('runResult');
  12.         return Ember.RSVP.all(transactions.concat(runResults)).then(function() {
  13.           return transactionResults;
  14.         })
  15.       })
  16.     });
  17.   },
  18.   setupController: function(controller, model) {
  19.     controller.set('model', model.transactions);
  20.     controller.set('runResults', model.runResults);
  21.     controller.set('transactionResults', model.transactionResults);
  22.     controller.set('runTypes', model.runTypes);
  23.   },
  24.   deactivate: function() {
  25.     this.controller.set('startDate', null);
  26.     this.controller.set('endDate', null);
  27.     this.controller.set('type', null);
  28.   }
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement