Thanks Akash. You’re totally right.
I’ve been getting the hint lately that it’s best to avoid overloading
init when possible in Ember, and this is certainly another convincing point for me. It does seem a little unintuitive that they’d behave differently, but clearly there’s some sort of magic that happens if
content is specified on
create vs being set as a property in
For posterity for anyone reading this thread…
// Akash's suggestion which solves my problem.
// My initial implementation which does not work as expected.
// CustomArray's init method.
Interestingly, I found that if I change the order of operations in my
init, that also fixes the issue.
Which makes sense to me now.
content must be specified before ArrayProxy’s
init() is invoked.