Created
March 3, 2017 16:15
-
-
Save feanor07/b0874ee60140a2e31518b64ec681dece to your computer and use it in GitHub Desktop.
Stackoverflow question:4258264
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({ | |
appName:'Stackoverflow question:4258264', | |
emailAddress: '', | |
message: '', | |
//**original properties** | |
isValid: Ember.computed.match('emailAddress', /^.+@.+\..+$/),//starts as false | |
validMessage: Ember.computed.gte('message.length', 5),//starts as false | |
//**my reversing boolean properties** | |
notYet: Ember.computed.not('isValid'),//starts as true | |
notNow: Ember.computed.not('validMessage'),//starts as true | |
//isDisabled must be true to be active disabling button | |
isDisabled: Ember.computed.or('notYet', 'notNow'),//starts as true}) | |
originalPropsAnded: Ember.computed.and('isValid', 'validMessage'),//starts as false}) | |
isDisabledNoted: Ember.computed.not('isDisabled') | |
}) |
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.11.0", | |
"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.10.2", | |
"ember-data": "2.11.0", | |
"ember-template-compiler": "2.10.2", | |
"ember-testing": "2.10.2" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment