ManuelDeLeon / viewmodel

MVVM for Meteor
https://viewmodel.org
MIT License
205 stars 23 forks source link

Attribute bindings lose camelCase (necessary for inline svg elements) #205

Closed fvpDev closed 8 years ago

fvpDev commented 8 years ago

Repro: https://github.com/fvpDev/_vmTestRepros/tree/Issue_205

1st svg sets attribute 'viewBox' whereas 2nd svg sets attribute 'viewbox' however because svg is xml, case is significant.

Lol I spent 4 hours racking my brain trying to understand what was going on.

ManuelDeLeon commented 8 years ago

The problem is that you're using an old version. Upgrade to v4.0.2 =)

fvpDev commented 8 years ago

Haha that's a good one. Thanks man!

fvpDev commented 8 years ago

It doesn't work if I were to use ViewModel.addAttributeBinding('viewBox');

    <div style='height: 1em; width: 2em; border: solid thin black'>
        <svg width='100%' height='100%' {{b "viewBox: viewBox"}}>
            <g>
                <rect fill='black' width='85' height='12' y='12'/>
                <rect fill='black' width='85' height='12' y='36.5'/>
                <rect fill='black' width='85' height='12' y='61'/>
            </g>
        </svg>
    </div>
ManuelDeLeon commented 8 years ago

I can't help you if you keep insisting in using old versions.

I honestly didn't test v4.0.3 (watching House of Cards) but it should be fine.

fvpDev commented 8 years ago

Works beautifully :D