Answer the question
In order to leave comments, you need to log in
Why doesn't this example work in ember 2.8?
Good afternoon. While mastering eber, I came across such an article with examples. The second section from the top is Data Binding, it contains an example with a list of 10,000 items and an edit field. If you run this example using the link from the article, then the field is edited without delay, but in the example, as I see it, ember 1.2 is used. I tried the same thing on version 2.8 and it began to slow down. Is this normal or am I doing something wrong? And is it possible to get the same behavior in new versions of ember?
route:
import Ember from 'ember';
import Item from './../item';
export default Ember.Route.extend({
model: function(){
return Ember.ArrayProxy.create({
content: Ember.A([Item.create()])
});
}
});
import Ember from 'ember';
import Item from './../item';
export default Ember.Controller.extend({
name: "Вася",
actions: {
render() {
var list = this.get("model");
for (var i=1; i< 10000; i++) {
list.addObject(Item.create({
id: i
}));
}
}
}
});
{{name}}<br>
{{input type="text" value=name}}
<br>
<button {{action "render"}}>render</button>
<ul>
{{#each model as |item|}}
<li>{{item.id}}</li>
{{/each}}
</ul>
{{outlet}}
import Ember from 'ember';
export default Ember.Object.extend({
id: 0
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question