How to replace Ember.ArrayController

What is the correct way to achieve this without Ember.ArrayController?

I know i can use normal js array and triger rerender manual or use Ember.Controller plus mixins to recreate Ember.ArrayController.

But all of them feels hacky,

Seems like i could use Ember.A().

The only problem is, although it has been there for a very long time, i can’t find it any where in the guides. Should i use it?

If you return an array from the route’s model hook, Ember is smart enough to set things up properly. You’ll be able to access the array within your controller with a simple this.model and within your template with model. Using Ember.A() is also a perfectly sound approach. You can read about it here.

Problem with return a array from model hook is i can’t find a proper way to update display after modify it. The only way i find to make it work is call rerender in the component manually.

@xudaiqing Ember Twiddle

1 Like

So native array already extend to have what Ember.A() give.

seems like i just missed http://guides.emberjs.com/v1.13.0/configuring-ember/disabling-prototype-extensions/