iStefo / ember-select-2

DEPRECATED IN FAVOR OF https://github.com/cibernox/ember-power-select
MIT License
144 stars 119 forks source link

Ember 1.10 / canary: Uncaught TypeError: Cannot read property 'each' of undefined #48

Open zyllorion opened 9 years ago

zyllorion commented 9 years ago

Using the code:

{{select-2 content=theReasons value=model.reason optionValuePath="id" placeholder="Choose a reason" label="Reason"}}

With the following defined in the controller:

export default Ember.Controller.extend({
    theReasons: [{
        id: "Reason 1",
        text: "Reason 1"
    }, {
        id: "Reason 2",
        text: "Reason 2"
    }],

I get the following error because theReasons can't be found:

Uncaught TypeError: Cannot read property 'each' of undefined

The same code used to work, not sure exactly which Ember version it broke with.

bradplank commented 9 years ago

Same issue with Ember 1.11.0-beta.1+canary.8127715c

Vincz commented 9 years ago

This issue seems related to the Ember.Assert call on line 61. Removing the following line and it works.

Ember.assert("select2 has to exist on Ember.$.fn.select2", Ember.$.fn.select2);
fantactuka commented 9 years ago

Same with Ember : 1.10.0-beta.4 Ember cli : 0.1.12

avanov commented 9 years ago

The same issue with Ember CLI 0.2.0.

It might be related to changes in handlebars scope and deprecations introduced in Ember 1.9.

andreyreyand commented 9 years ago

me too.. Ember : 1.12.0 Ember Data : 1.0.0-beta.17