Skip to content

Element wrapper of .innerHTML for data binding with HTML elements.

Notifications You must be signed in to change notification settings

StartPolymer/s-html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

<s-html>

Element wrapper of .innerHTML for data binding with HTML elements.

Usage

Example 1

Localize text with HTML elements using app-localize-behavior.

locales.json

{
"text": "<a href=\"/settings\">Settings</a>"
}

HTML

<s-html html="[[localize('text')]]"></s-html>

Example 2

Using span element for content styled with CSS.

locales.json

{
"text": "<a class=\"red\" href=\"/settings\">Settings</a>"
}

CSS

.red {
  color: red;
}

HTML

<s-html html="[[localize('text')]]"><span></span></s-html>

Example 3

Unescape escaped HTML elements.

locales.json

{
"text": "polymer &lt;br&gt;"
}

HTML

<s-html unescape html="[[localize('text')]]"></s-html>

Installation

bower i s-html -S

License

MIT: StartPolymer/license

About

Element wrapper of .innerHTML for data binding with HTML elements.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages