component / reactive

Tiny reactive template engine
383 stars 48 forks source link

`null` wrapped in a `reactive.get` #138

Open cristiandouce opened 10 years ago

cristiandouce commented 10 years ago

A teamplate like this:

<code data-text="{JSON.stringify(this, null, 2)}"></code>

Leads to the following execution error:

vendethiel commented 10 years ago

eval/new Function lead to new context like this one

defunctzombie commented 10 years ago

Maybe null should be special cased. What I recommend in this case tho is to invoke a view function that returns a string formatted as you like.

cristiandouce commented 10 years ago

The thing is I'm inside an each iteration on a model's sub-array of objects. When I try to invoke major's model function, I get undefined cannot be called as a function error, since in the scope, this reffers to the current object on the array...

cristiandouce commented 10 years ago

Sorry my issue description didn't provide that info.

defunctzombie commented 10 years ago

Maybe I don't understand the issue. Can you provide a failing example with the each issue and I can take a look.