Skip to content

Instantly share code, notes, and snippets.

@Subtletree
Last active March 2, 2018 00:33
Show Gist options
  • Save Subtletree/c3f8cbdcb1fc4be661e0bcad9fcc9bf8 to your computer and use it in GitHub Desktop.
Save Subtletree/c3f8cbdcb1fc4be661e0bcad9fcc9bf8 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement() {
this._super(...arguments);
document.getElementById('box-5').scrollIntoView({
behavior: 'smooth'
});
}
});
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;
}
.box {
height: 300px;
background-color: #f5f5f5;
margin: 20px;
}
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{parent-component}}
{{yield}}
<div id="box-{{index}}" class='box'>
{{index}}
</div>
{{yield}}
{{child-component index=0}}
{{child-component index=1}}
{{child-component index=2}}
{{child-component index=3}}
{{child-component index=4}}
{{child-component index=5}}
{{child-component index=6}}
{{child-component index=7}}
{{child-component index=8}}
{
"version": "0.13.0",
"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.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment