Last active
August 28, 2019 18:49
-
-
Save alexdiliberto/507b94ff5a983b6e75bdfe00943436c5 to your computer and use it in GitHub Desktop.
New Twiddle
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 Component from '@ember/component'; | |
export default Component.extend({ | |
numberOfSaves: 0, | |
message: '', | |
helloMessage: Ember.computed('username', function() { | |
return `Hello, ${this.get('username')}. Welcome!`; | |
}), | |
actions: { | |
clear: function() { | |
this.set('numberOfSaves', 0); | |
this.set('message', ''); | |
}, | |
saveUser: function() { | |
let self = this; | |
this.incrementProperty('numberOfSaves'); | |
return this.get('save')() | |
.then(function(result) { | |
self.set('message', result); | |
}, function(err) { | |
self.set('message', 'Save Failed!'); | |
}); | |
} | |
} | |
}); |
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 Controller from '@ember/controller'; | |
export default Controller.extend({ | |
appName: 'Polarity', | |
username: "admin", | |
actions: { | |
test: function() { | |
console.info("You pressed 'test'"); | |
}, | |
save: function() { | |
console.info("You pressed 'Save User'"); | |
return new Promise(function(resolve, reject) { | |
return resolve('Save Succeeded!'); | |
}); | |
} | |
} | |
}); |
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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.user-portrait-card { | |
background-color: #ccc; | |
padding: 20px; | |
} |
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.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment