Created
May 17, 2017 03:12
-
-
Save Kerrick/6ab49997506414547103d7274a6532d4 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.Controller.extend({ | |
firstName: '', | |
lastName: '', | |
fullName: Ember.computed('firstName', 'lastName', function() { | |
const firstName = this.get('firstName'); | |
const lastName = this.get('lastName'); | |
if (firstName && lastName) { | |
return `${firstName} ${lastName}`; | |
} else if (lastName) { | |
return `Mx. ${lastName}`; | |
} else { | |
return firstName; | |
} | |
}), | |
alertGreeting() { | |
const fullName = this.get('fullName'); | |
const hasName = !Ember.isEmpty(fullName); | |
alert(`Hello${hasName ? `, ${fullName}` : ''}!`); | |
}, | |
actions: { | |
formSubmitted(event) { | |
event.preventDefault(); | |
this.alertGreeting(); | |
} | |
} | |
}); |
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
:root { | |
--mdc-theme-primary: #0e4ead; | |
} | |
.mdc-ripple-surface.mdc-ripple-upgraded.mdc-button--primary::before, | |
.mdc-ripple-surface.mdc-ripple-upgraded.mdc-button--primary::after { | |
background-color: rgba(255, 255, 255, .2); | |
} | |
#greeting-form > button { | |
margin-top: 8px; | |
} |
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.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-material-components-web": "*", | |
"ember-data": "2.12.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment