Reputation: 3666
I am trying to use Ember.Select
in my template. Ember.Select
works without any attribute | properties. But when I specify a attribute content, it gives me error as
Uncaught Error: assertion failed: an Ember.CollectionView's content must implement Ember.Array. You passed countries
My emblem template is as follows,
Ember.Select // Works fine
Ember.Select content=countries //Gives the listed error
The code in App.IndexController is,
countries : function () {
return ["India","US","England"]; // I have also tried passing the value in Ember.A(array_val)
}.property('')
Upvotes: 0
Views: 70
Reputation: 564
I'm not familiar with Emblem but first off, it's probably worth trying to create a select as per the API documentation and defining countries
as a literal array.
countries : ["India","US","England"],
However I think that your problem is that you are defining it as a .property('')
called nothing. If you don't want to rename your property, just set it like this: .property()
, or if you want to call it something different .property('countriesCollection')
. This would then allow you to use countriesCollection
in your templates.
You should also have a look into computed properties, as presumably you want to do something to your array (otherwise it might as well be a literal array).
On another note, Ember 1.13 has deprecated views, so you should actually look to move to a component driven approach, instead of using views and controllers. There is a good select
component called x-select which is compatible with the Ember.Select view API.
Upvotes: 4