[OPEN] Behavoiur of the "Default Available Modifiers" default - Printable Version
+- Aria Templates Forums (http://ariatemplates.com/forum)
+-- Forum: Public forums (/forumdisplay.php?fid=3)
+--- Forum: General framework discussions (/forumdisplay.php?fid=4)
+--- Thread: [OPEN] Behavoiur of the "Default Available Modifiers" default (/showthread.php?tid=110)
[OPEN] Behavoiur of the "Default Available Modifiers" default - donk - 8 November 2013 10:53
I created a template and used the default modifier to specify a default value:
Your documentation states:
Quote:This modifier returns the default value if the entry value is equal to null (this is a non-strict equal, so "" is considered as null).
So I guess the behavior is correct regarding your documentation. But I think it would be more practical for everyday use if you extend the check , so that the default value will always be printed if the expression evaluates to null or throws an TypeError.
Otherwise I would have to use this form instead, which is more code for the same default behavior.
And it gets worse if the nesting is even deeper
So either extending the default modifier or another modifier for this situation would be nice.
RE: Behavoiur of the "Default Available Modifiers" default - jakub-g - 11 November 2013 14:27
I agree it would indeed be useful to have this feature from the TPL writer perspective to save some code - even separated from the modifiers.
Side note: CoffeeScript supports that feature, but using a special
It was considered to be added to C# as
Following the CoffeeScript, basically, the input string
But let's consider the following
This would have to be translated recursively into sth like
It's useful from the user perspective, however this would further complicate our parser and the Eclipse editor. What's the team opinion on this?
RE: Behavoiur of the "Default Available Modifiers" default - susanta.behera - 12 November 2013 12:17
This will be a good feature addition.
+1 for this