Re: [w3c/webcomponents] [templates] Consider ${foo} instead of {{foo}} (#688)

The disadvantage to choosing the same syntax as JavaScript is that it makes it more difficult to create templates as template literals *in* JavaScript (you have to remember to escape them all). For ex:

```js
template.innerHTML = `
  <h1>\${name}</h1>
  <h2>${title}</h2>
`;
```

Would throw assuming `title` is not in scope b/c you forgot to escape it. If it were in scope you might be scratching your head as to why the templates were not behaving as you expected.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/688#issuecomment-341465220

Received on Thursday, 2 November 2017 15:48:06 UTC