Skip to content

Instantly share code, notes, and snippets.

@EWhite613
Created October 19, 2018 17:27
Show Gist options
  • Save EWhite613/e40fc54ca7eaff9838880724e390bf14 to your computer and use it in GitHub Desktop.
Save EWhite613/e40fc54ca7eaff9838880724e390bf14 to your computer and use it in GitHub Desktop.
vert?
import Ember from 'ember';
function createArrayWithLength(n) {
var arr = [], i;
for(i = 0; i < n; i++) {
arr.push(i);
}
return arr;
}
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
items: createArrayWithLength(100)
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{#vertical-collection
items
tagName='ul'
estimateHeight=50
staticHeight=false
bufferSize=1
renderAll=false
renderFromLast=false
idForFirstItem=idForFirstItem
firstReached=firstReached
lastReached=lastReached
firstVisibleChanged=firstVisibleChanged
lastVisibleChanged=lastVisibleChanged
as |item i|}}
<li>
{{item.number}} {{i}}
</li>
{{/vertical-collection}}
<br>
<br>
{
"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",
"@html-next/vertical-collection": "1.0.0-beta.12"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment