Created
March 16, 2018 21:24
-
-
Save bryanaka/dee9f012bf6ce97624ba78c1cc0ee10b to your computer and use it in GitHub Desktop.
New Twiddle
This file contains 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.Component.extend({ | |
isPopulated: false, | |
isNotPopulated: Ember.computed.not('isPopulated'), | |
isEditing: Ember.computed.reads('isNotPopulated'), | |
encryptedText: '************', | |
valueDidChange: undefined, | |
fieldName: undefined, | |
underscoredFieldName: Ember.computed('fieldName', function() { | |
return Ember.String.underscore(this.get('fieldName')); | |
}), | |
actions: { | |
editField() { | |
console.log('hi') | |
this.set('isEditing', true); | |
}, | |
updateValue(value) { | |
this.sendActions('valueDidChange', value); | |
} | |
} | |
}); |
This file contains 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: 'Ember Twiddle', | |
populatedEncryptedFields: ['value'] | |
}); |
This file contains 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 function contains([haystack, needle]/*, hash*/) { | |
return Ember.makeArray(haystack).contains(needle); | |
} | |
export default Ember.Helper.helper(contains); |
This file contains 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.13.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.16.2", | |
"ember-template-compiler": "2.16.2", | |
"ember-testing": "2.16.2" | |
}, | |
"addons": { | |
"ember-data": "2.16.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment