You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use an undefined variable in a template, hashspace wants to be user-friendly and treats this as an empty string.
That's okay, it's certainly better than to break the whole application, but I think things like this should be logged into the console, because they can hide a developer's bug and it might be tricky to immediately know that in big apps with complex logic. The experience of many projects shows that too much user-friendliness can bite in the least expected moments and make debugging painful.
# template mytest()
<div>
{let foo = 1}
<p>Fuu has a value of: {fuu}</p>
// oh I wanted to use foo, but I was really sloppy when writing that, and I forgot to validate
</div>
# /template
mytest().render("output");
The text was updated successfully, but these errors were encountered:
Having said that I am not against a specific option - but I guess it should be scoped, like {let} - otherwise you may have many logs in a large application, which would result in painful troubleshooting..
When I use an undefined variable in a template, hashspace wants to be user-friendly and treats this as an empty string.
That's okay, it's certainly better than to break the whole application, but I think things like this should be logged into the console, because they can hide a developer's bug and it might be tricky to immediately know that in big apps with complex logic. The experience of many projects shows that too much user-friendliness can bite in the least expected moments and make debugging painful.
http://plnkr.co/edit/FNuImk92ug07LxzZU7ue?p=preview
The text was updated successfully, but these errors were encountered: