Skip to content

Instantly share code, notes, and snippets.

@robomalo
Created November 1, 2019 23:06
Show Gist options
  • Save robomalo/44f6169e4b23aeb7a33499432bd56871 to your computer and use it in GitHub Desktop.
Save robomalo/44f6169e4b23aeb7a33499432bd56871 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
hasMessage: false,
actions: {
toggleMessage() {
this.toggleProperty('hasMessage');
},
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.card {
border: 1px solid gray;
margin: 20px auto;
padding: 20px;
width: 250px
}
.buttons {
display: flex;
}
.button {
flex: 1;
}
.message {
background-color: yellow;
}
<div class="card">
<div class="buttons">
<button class="button" {{action "toggleMessage"}}>Like</button>
<button class="button">Comment</button>
</div>
{{#if hasMessage}}
<div class="message" aria-live="polite">
<h2>Like buttons are super dope!</h2>
<p>Some message here! <a href="">Learn more!</a></p>
</div>
{{/if}}
</div>
{
"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": {
"ember-data": "3.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment