Hi,
In the helper function of can.stache.registerHelper, how do I know if the helper is being called with a block or without a block?
So, if I call the 'myHelper' helper like this:
- {{myHelper}}
- {{#myHelper}}
- {{message}}
- {{/myHelper}}
- can.stache.registerHelper('myHelper', function(options) {
- if (<test here>) {
- // helper called without block
- return 'I was called without a block';
- }
- else {
- // helper called with block
- return options.fn({message: 'I was called with block'});
- };
- });