Last active
February 6, 2016 10:24
-
-
Save lovelykaushik86/5f8447dfc8a858aebf6a 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({ | |
appName: 'Jumping Balls', | |
jumpingBalls: [{"newBall": true}], | |
ball: {"newBall": true}, | |
actions: { | |
} | |
}); |
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({ | |
didInsertElement: function () { | |
var that = this; | |
// setInterval(function(){ | |
// that.send("addBalls"); | |
//}, 5000); | |
}, | |
init: function () { | |
var tmp = '<div style="cursor:pointer" {{action "addBalls"}}>Add new balls</div><br/><div class="canvas">{{#each jumpingBalls as |ball|}}<div class="ball"></div><br/>{{/each}}</div>'; | |
this.set('layout', Ember.Handlebars.compile(tmp)); | |
this._super(); | |
}, | |
actions: { | |
addBalls: function () { | |
for (var i = 0; i < 5; i++) { | |
this.get("jumpingBalls").pushObject(""); | |
} | |
} | |
} | |
}); |
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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.canvas { | |
border: 1px solid black; | |
width:100%; | |
height:300px; | |
overflow:auto; | |
} | |
.ball { | |
border:thin solid black; | |
width:25px; | |
height:25px; | |
border-radius:66%; | |
background:orange; | |
} |
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.5.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember.debug.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment