leonidas / transparency

Transparency is a semantic template engine for the browser. It maps JSON objects to DOM elements by id, class and data-bind attributes.
http://leonidas.github.com/transparency/
MIT License
969 stars 112 forks source link

Object is undefined when returning target.element.transparency.model in v0.8.0. #87

Closed hex closed 11 years ago

hex commented 11 years ago

I am experiencing a strange behaviour in v0.8.1. I made two fiddles:

(using v0.7.11) > http://jsfiddle.net/hexaust/XG7Gk/ (using v0.8.0) > http://jsfiddle.net/hexaust/wyygS/

As you can see the output of the console.log is different, one returns the object and the other one says 'undefined'.

I hope I am making this clear I don't know how to describe the issue in any other way. Thanks!

pyykkis commented 11 years ago

Apologies for the inconveniences you've had lately - you've successfully covered quite a few corner cases. I implement automatic test cases for each of this along with the fixes. That should prevent regression in the future.

As a workaround proposal / question. Do you need specifically element.transparency.model in the directives? The same object is available through this reference. And after rendering, element.transparency.model is available as usual. Please see http://jsfiddle.net/wyygS/16/ for the demonstration.

That said, I definitely agree it's logical and consistent to have element.transparency.model available in directive functions, too. So, will fix.

Thanks for the invaluable and accurate issue reports!

pyykkis commented 11 years ago

Fixed in v0.8.2.