Skip to content
This repository was archived by the owner on Mar 29, 2018. It is now read-only.

Use javascript multiline strings #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

piotr-cz
Copy link
Contributor

Instead of

$templateCache.put("MyBundle", ""
+ "<div id=\"sidebar-left\">"
+ "    innerText"
+ "</div>"
);

use

$templateCache.put("MyBundle", "\
<div id=\"sidebar-left\">\
    innerText\
</div>\
");

Which is more readable imho.

@padakuro
Copy link
Member

Mh not sure on this, since there are already some backslashes to escape the double quotes. I prefer the first version. Anyone else got some thoughts on this?

@piotr-cz
Copy link
Contributor Author

There should not be a conflict, since backslashes are added only at the end of line, but I agree it's a matter of preference.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants