Closed manking99 closed 7 years ago
First of all, {{#"MY BLOCK"}}...{{/"MY BLOCK"}}
is not a partial-call. It's a block-helper call (like in https://jsfiddle.net/9D88g/167/), or a statement that iterates over an array (see https://jsfiddle.net/9D88g/168/).
strict
-compile option (see https://jsfiddle.net/9D88g/166/) to throw a compile error, if "MY BLOCK" is not registered as helper and does not exist as property of the input object.{{else}}
-block and throw an error from inside a helper (but this seems pretty complicated) (see this fiddle https://jsfiddle.net/9D88g/165/)For block-partial calls (like in https://jsfiddle.net/9D88g/169/), Handlebars will always evaluate the contents of the block if the partial does not exist. If it does exist and contains a {{@partial-block}}
statement, the contents will be evaluated and inserted at this statement (see https://jsfiddle.net/9D88g/170/). There is no way to distinguish between these two cases.
When "MY BLOCK", was not registered with Handlebars.registerPartial, how to check if it not exist and throw error?
{{#"MY BLOCK"}}' '123', {{/"MY BLOCK"}}'