webark/ember-component-css

Issues with ember-component-css and ember-cli-typescript

psbanka opened this issue · 3 comments

Hello. I am having an issue with the latest ember-cli-typescript and ember-component-css. I'm getting a

Cannot set property styleNamespace of [object Object] which has only a getter

Sometimes a person needs to use the styleNamespace attribute within, for example, a computed properties of the component, and it's therefore useful to define styleNamespace: string within the class so that TypeScript can type-check it properly. This, however, results in the above error.

Any ideas?

@psbanka and this is in the component, not a controller correct?

Yes, that is correct

https://github.com/ebryn/ember-component-css/blob/6c669ed44deb26d66b9ee98641fd3d10a53fcf49/addon/initializers/component-styles.js#L37-L41

you could redefine the whole computed property. Or maybe we could move the setting of this to the init.