canjs / can-stache

Live binding handlebars templates
https://canjs.com/doc/can-stache.html
MIT License
10 stars 13 forks source link

Lack of warning and unexpected value from prop={{#if()}}"value0"{{else}}"value1"{{/if}} #630

Closed mjstahl closed 5 years ago

mjstahl commented 5 years ago

Given the following binding:

childProperty:raw={{#if(isSomething)}}"something"{{else}}"something else"{{/if}}

In the DOM the binding is rendered as follows:

child:u:property:raw=""something""

On the child component childProperty is defined as type: 'string'. The value of childProperty is '' (empty-string).

I was informed that this syntax is not supported by stache, but there is also no warning or error on the console.

If this is not valid syntax, we should inform the developer with a warning or an error.

justinbmeyer commented 5 years ago

This probably needs to be fixed in can-view-parser

cherifGsoul commented 5 years ago

Should this issue be moved to can-view-parser ?