Brandon
Brandon

Reputation: 1013

In Ember, can services have computed properties?

It appears from the API that services in Ember extends the main Ember object base class, which implements the observable class, but when I define a property in my Ember service with .property, my tests fail with undefined is not a function.

Upvotes: 1

Views: 273

Answers (1)

Brandon
Brandon

Reputation: 1013

It turns out that, yes, Ember services can have computed properties, and that this bug came from something else. In my tests I was calling service.numberOfThings() and after appending .property() to numberOfThings: function(){...} I needed to change the test code to service.get('numberOfThings');

Upvotes: 1

Related Questions