Skip to content

Instantly share code, notes, and snippets.

@mohamedali-s-4725
Last active June 16, 2016 13:05
Show Gist options
  • Save mohamedali-s-4725/3c161f606b52374649b10e54b6b88540 to your computer and use it in GitHub Desktop.
Save mohamedali-s-4725/3c161f606b52374649b10e54b6b88540 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
actions:{
alertMe(){
alert('Initiated!');
Ember.run.later( ()=>{
alert('Done..!')
},5000);
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
alert: false,
actions: {
toggleComponent(){
this.toggleProperty('alert');
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{#if alert}}
{{alert-msg}}
{{/if}}
<br><br><br>
<button {{action 'toggleComponent'}}> Toggle Component! </button>
{{outlet}}
<br>
<br>
<button {{action 'alertMe'}} >Click me..</button>
{{yield}}
{
"version": "0.9.2",
"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.6.0",
"ember-data": "2.6.0",
"ember-template-compiler": "2.6.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment