Created
February 9, 2015 22:02
-
-
Save thejohnnybot/ab9aae5a23cf7efa5025 to your computer and use it in GitHub Desktop.
Ejemplo
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'; | |
| import config from '../config/environment'; | |
| var fmt = Ember.String.fmt; | |
| var oneWay = Ember.computed.oneWay; | |
| var isBlank = Ember.isBlank; | |
| export default Ember.ArrayController.extend(Paginatable, { | |
| firstName: null, | |
| lastName: null, | |
| license: null, | |
| phone: null, | |
| email: null, | |
| zip: null, | |
| page: 1, | |
| firstNameField: oneWay('firstName'), | |
| lastNameField: oneWay('lastName'), | |
| licenseField: oneWay('license'), | |
| phoneField: oneWay('phone'), | |
| emailField: oneWay('email'), | |
| zipField: oneWay('zip'), | |
| activateLoading: function() { | |
| this.set('isLoading', true); | |
| }.observes('firstName', 'lastName', 'license', 'phone', 'email', 'zip', 'startDate', 'endDate'), | |
| newQuoteHref: function() { | |
| return fmt(config.newQuoteURL, this.get('slug')); | |
| }.property('slug'), | |
| actions: { | |
| search: function() { | |
| this.setProperties({ | |
| firstName: this.get('firstNameField'), | |
| lastName: this.get('lastNameField'), | |
| license: this.get('licenseField'), | |
| phone: this.get('phoneField'), | |
| email: this.get('emailField'), | |
| startDate: moment(this.get('startDateField'), "MM/DD/YYYY").format("YYYY-MM-DD"), | |
| endDate: moment(this.get('endDateField'), "MM/DD/YYYY").format("YYYY-MM-DD"), | |
| zip: this.get('zipField'), | |
| page: 1 | |
| }); | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment