# Possible Bug: flattening capitalization on parameter name in component instantiation

**URL:** <https://forums.bitovi.com/t/possible-bug-flattening-capitalization-on-parameter-name-in-component-instantiation/386>\
**Category:** CanJS\
**Created:** [August 12, 2016, 6:29pm UTC](https://forums.bitovi.com/t/possible-bug-flattening-capitalization-on-parameter-name-in-component-instantiation/386 "2016-08-12T18:29:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tqwhite](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/tqwhite/32/147_2.png) [@tqwhite](https://forums.bitovi.com/u/tqwhite)\
**Post date:** [August 12, 2016, 6:29pm UTC](https://forums.bitovi.com/t/possible-bug-flattening-capitalization-on-parameter-name-in-component-instantiation/386/1 "2016-08-12T18:29:58Z")

</div>

Creating a component in the normal way, I sent some data to it with:

`<conditions-workspace-item-editor {workingCondition}="." />`

I had fits trying to use it in the target component. Eventually, I found this:

![](https://canada1.discourse-cdn.com/flex035/uploads/donejs/original/1X/dbc5c34ef646db4fede96e3ca27d3fca88288eb7.png)

Notice that the ‘C’ in ‘workingCondition’ has been lowercased to ‘workingcondition’

In addition, I had declared the property in the target component’s define section…

![](https://canada1.discourse-cdn.com/flex035/uploads/donejs/original/1X/db0300cf0e3fafa87afe2c04c9d443b28023b31e.png)

and that declared camel case version disappears.

I would have expected (considering the strange lowercasing behavior) that I would have two properties, one the declared one, ‘workingCondition’, and the other the inserted one, ‘workingcondition’.

If I am supposed to use all lowercase names in parameter passing, I could not find it in the docs.

I do not know what to make of this.

tqii

---

<div class="post-metadata">

**Author:** ![DylanRoss](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/dylanross/32/71_2.png) [@DylanRoss](https://forums.bitovi.com/u/DylanRoss)\
**Post date:** [August 12, 2016, 7:01pm UTC](https://forums.bitovi.com/t/possible-bug-flattening-capitalization-on-parameter-name-in-component-instantiation/386/2 "2016-08-12T19:01:40Z")

</div>

HTML is case insensitive so you should be hyphenating attributes like `{working-condition}="."`. There was a somewhat recent issue ([#2391](https://github.com/canjs/canjs/issues/2391)) to have can-stache automatically convert camelCase attributes to kebab-case which could prevent confusion.

---

<div class="post-metadata">

**Author:** ![tqwhite](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/tqwhite/32/147_2.png) [@tqwhite](https://forums.bitovi.com/u/tqwhite)\
**Post date:** [August 12, 2016, 7:06pm UTC](https://forums.bitovi.com/t/possible-bug-flattening-capitalization-on-parameter-name-in-component-instantiation/386/3 "2016-08-12T19:06:25Z")

</div>

Actually, the opposite is happening. Kebab-case is converted to camelCase.

`<conditions-workspace-item-editor {working-condition}="." />`

Produces:

![](https://canada1.discourse-cdn.com/flex035/uploads/donejs/original/1X/7e010d477aa405f0b7c5c23a10c637d1cde84a64.png)

---

<div class="post-metadata">

**Author:** ![DylanRoss](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/dylanross/32/71_2.png) [@DylanRoss](https://forums.bitovi.com/u/DylanRoss)\
**Post date:** [August 12, 2016, 7:42pm UTC](https://forums.bitovi.com/t/possible-bug-flattening-capitalization-on-parameter-name-in-component-instantiation/386/4 "2016-08-12T19:42:21Z")

</div>

The scope bindings convert kebab-case attributes to camelCase properties, yes, but in order for you to compose a template with camelCase attributes and have them properly interpreted, stache would have to convert them to kebab-case first (which is the suggestion) so they are accurately represented in the DOM for the secondary conversion.

---

<div class="post-metadata">

**Author:** ![tqwhite](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/tqwhite/32/147_2.png) [@tqwhite](https://forums.bitovi.com/u/tqwhite)\
**Post date:** [August 12, 2016, 9:22pm UTC](https://forums.bitovi.com/t/possible-bug-flattening-capitalization-on-parameter-name-in-component-instantiation/386/5 "2016-08-12T21:22:56Z")

</div>

That makes sense. Thanks.
