Template strings as a template language

Isiah Meadows isiahmeadows at gmail.com
Wed Sep 16 00:15:10 UTC 2015


Sent with the wrong subject...

On Tue, Sep 15, 2015 at 7:03 PM, Isiah Meadows <isiahmeadows at gmail.com> wrote:
> I think you forgot to change the subject/strip other content/etc. ;)
>
> Plus, I learned the hard way myself that it's easier to have my
> subscription set to forward everything. It's not a particularly high
> volume list.
>
> On Mon, Sep 14, 2015 at 12:59 AM, Mohsen Azimi <me at azimi.me> wrote:
>> I actually used template strings as templateing in two of my projects. You
>> can take aa look here:
>>
>> https://github.com/mohsen1/json-schema-view-js/blob/master/src/index.js#L59-L175
>>
>> Two main problems I had with this was:
>>
>> * There is no `if` condition in template strings. I had to **hack** my way
>> by yet another template string function that returns empty string if the
>> condition is falsy:
>> https://github.com/mohsen1/json-schema-view-js/blob/master/src/helpers.js#L9-L21
>> * The falsy stuff are not rendered as you expect (empty string):
>>
>> ```js
>> let o = undefined;
>> console.log(`${o}`); // => 'undefined'
>> ```
>>
>

[omitted]

>
>
> --
> Isiah Meadows



-- 
Isiah Meadows


More information about the es-discuss mailing list