silvenon
silvenon

Reputation: 2197

Em.View.create deprecation warnings

I have a CollectionView which has itemViewClass set up to a template which has an action that opens a modal containing the same data, but displayed in a different way. The modal is generated as a view and is passed the content from itemViewClass, but upon .append() the defaultContainer deprecation warning comes up.

Without further ado, here is the JS Bin.

Upvotes: 0

Views: 43

Answers (1)

shime
shime

Reputation: 9018

The explanation for the deprecation warning you're seeing can be found in this gist.

Here is an updated jsbin with (hopefully) the solution to your problem.

Passing in the container removes the deprecation warning, but this is not an idiomatic Ember code you would find in your neighbour's application. Usually you would use a transient route that would populate another outlet with your modal.

You expected bindings would work when you pass plain old JavaScript object to Ember.View, but that is not the case. Wrap that in the Em.Object and everything gets wired up.

Also, please be a bit more descriptive with your questions, it was a little tricky to find out what you were trying to accomplish here.

Upvotes: 2

Related Questions