Skip to content

Commit

Permalink
Fix isServiceFactory deprecation with Ember 1.13
Browse files Browse the repository at this point in the history
Since Ember 1.13, Ember expects that services either extend
`Ember.Service`, or they must set `isServiceFactory` to `true` at the
class level. Since the Cart service already extends `ArrayProxy`, this
commit reopens the Cart service class to set `isServiceFactory` to
`true`.

See emberjs/ember.js#11261
  • Loading branch information
iancanderson committed Jan 19, 2016
1 parent 6138d96 commit aeae23b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion addon/services/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {

const get = Ember.get;

export default ArrayProxy.extend({
const CartService = ArrayProxy.extend({
pushItem(item) {
let cartItem;

Expand Down Expand Up @@ -76,3 +76,9 @@ export default ArrayProxy.extend({
}
}))
});

CartService.reopenClass({
isServiceFactory: true
});

export default CartService;

0 comments on commit aeae23b

Please sign in to comment.