Observing `ContainerView` as an array


Is there a practical alternative to observing ContainerView as an array? I need to manually manage an array of views, and some of those views have properties based off of their position within their parent, for example:

number: function getNumber() {
  return `Number ${this.get('parentView').indexOf(this)}: `;

I’m getting deprecation warnings, but am not aware of an alternative.


I guess the new fangled way would be to switch your views to components and pass in the parental index data.

Using the awesomeness of each with index you could do something like

{{#each people as |person index|}}
  {{! The first index value will be 0 }}
  {{your-awesome-component position=index}}


Ah, good call. I’ll give this a whirl.