Panman82 / ember-bootstrap-switch

An ember-cli addon to import bootstrap-switch and provide an Ember component.
MIT License
5 stars 4 forks source link

Ember 2.8.0 and getAttrFor #16

Closed steveclarkin closed 8 years ago

steveclarkin commented 8 years ago

Have just upgraded my project from Ember 2.7.3 to 2.8.0 and it looks like ember-bootstrap-switch broke.

Error: Uncaught TypeError: this.getAttrFor is not a function

https://github.com/Panman8201/ember-bootstrap-switch/blob/master/addon/components/bootstrap-switch.js#L145

Panman82 commented 8 years ago

(sigh) They must have removed getAttrFor from ember, which was technically private but useful. I use that in other addons so I'll have to look into it, but I think the bootstrap-switch plugin is dead. Unfortunately there hasn't been any activity in over a year. Not sure when I'll get a chance to debug (I no longer use Bootstrap or this addon), but would welcome a PR.

hoangdt84 commented 8 years ago
getAttrFor: function(attrs, key) {
    let val = attrs[key];
    return val && val.value !== undefined ? val.value : val;
  },

add this function into this component and it should work.

dolgafar commented 8 years ago

Cool.. works, i've created a PR for it.

Panman82 commented 8 years ago

Fixed by #18