ManuelDeLeon / viewmodel

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

Viewmodel-checks complains without reason #257

Closed arggh closed 8 years ago

arggh commented 8 years ago

If I have a ref-binding inside an #if-block, ViewModel will complain about the already existing property when the if-condition is toggled.

viewmodel-checks.coffee:120 The view model for template 'test' already has a property 'button'. You're trying to use it as the name for a ref binding.refBinding @ viewmodel-checks.coffee:120VmCheck @ viewmodel-checks.coffee:124ViewModel.check @ viewmodel.coffee:101bind @ bindings.coffee:340ViewModel.bindSingle @ viewmodel.coffee:431ViewModel.bind @ viewmodel.coffee:693(anonymous function) @ viewmodel.coffee:218Tracker._runFlush @ tracker.js:497onGlobalMessage @ setimmediate.js:102

This should reproduce the problem. Just click the "show button" -button repeatedly. After the first round, you should get a complaint from viewmodel-checks.coffee.

https://github.com/arggh/viewmodel-refbinding

Dartv commented 8 years ago

+1

The view model for template 'StandardsCard' already has a property 'collapse'. You're trying to use it as the name for a ref binding.
michaelrokosh commented 8 years ago

+1 Any progress on this issue, @arggh, @ManuelDeLeon?

ManuelDeLeon commented 8 years ago
// TODO: Insert lame excuse for dealing with this so late

Fixed in manuel:viewmodel-debug v 2.7.1