machty / emblem.js

Emblem.js - Ember-friendly, indented syntax alternative for Handlebars.js
http://emblemjs.com
MIT License
1.04k stars 81 forks source link

How can I use Ember.Select component in emblem #243

Closed ghost closed 9 years ago

ghost commented 9 years ago

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

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('')
mixonic commented 9 years ago

@sabapk Your CP should look like:

  countries: Ember.computed(function() {
    return Ember.A(['India', 'US', 'England']);
  }),

I'm not sure what else is happening, but it is not very likely to be an issue with Emblem. I encourage you to take up this question on StackOverflow, the #emberjs IRC channel, or the Ember.js Community Slack (find a link on emberjs.com).