Last active
June 29, 2017 14:05
-
-
Save feanor07/a7cffb165d9d27575b90f55d8276b0f8 to your computer and use it in GitHub Desktop.
so#44824022
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({ | |
emailAddress:'', | |
isValid: Ember.computed.match('emailAddress', /^.+@.+\..+$/), | |
isDisabled: Ember.computed.not('isValid'), | |
actualEmailAddress: Ember.computed('emailAddress', function() { | |
console.log('actualEmailAddress function is called: ', this.get('emailAddress')); | |
}), | |
emailAddressChanged: Ember.observer('emailAddress', function() { | |
console.log('observer is called', this.get('emailAddress')); | |
}), | |
actions: { | |
saveInvitation() { | |
alert(`Saving of the following email address is in progress: ${this.get('emailAddress')}`); | |
this.set('responseMessage', `Thank you! We've just saved your email address: ${this.get('emailAddress')}`); | |
this.set('emailAddress', ''); | |
}, | |
onchange(val) { | |
alert(val); | |
} | |
} | |
}); |
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.12.1", | |
"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.12.0", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": { | |
"ember-data": "2.12.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment