ember-component-css icon indicating copy to clipboard operation
ember-component-css copied to clipboard

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

Open psbanka opened this issue 6 years ago • 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 avatar Jul 26 '19 21:07 psbanka

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

webark avatar Aug 12 '19 19:08 webark

Yes, that is correct

psbanka avatar Aug 15 '19 18:08 psbanka

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.

webark avatar Aug 17 '19 12:08 webark