ember-ajax icon indicating copy to clipboard operation
ember-ajax copied to clipboard

handlebar helpers for is*Error checks

Open cythrawll opened this issue 8 years ago • 1 comments

I have made one or two handlebars helpers that check for specific error codes to show custom views by checking the reason property in ProxyMixins. Thought such helpers would be handy to have in this library.

{{#if (is-forbidden data.reason)}}
   <p>You don't have access to this</p>
{{/if}}

cythrawll avatar Nov 16 '17 05:11 cythrawll

That's an interesting idea. I was going to push back and say that I wouldn't want to incur the payload cost on everyone for a feature only some would need, but we could go the ember-composable-helpers route and have uses opt into (or out of) which helpers they want to include. That way we could exclude them all by default and avoid the payload cost, but allow users to add them as needed.

alexlafroscia avatar Nov 25 '17 18:11 alexlafroscia