Skip to content
 
 

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

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": "<span>Settings</a>"
}

HTML

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

Example 2

Using element content styled with CSS.

locales.json

{
"text": "<span class=\"red\">Settings</span>"
}

CSS

.red {
  color: red;
}

HTML

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

Example 3

Using element content styled with CSS within an element.

locales.json

{
"text": "<span class=\"red\">Settings</span>"
}

CSS

.red {
  color: red;
}

HTML

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

Example 4

Unescape escaped HTML elements.

locales.json

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

HTML

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

Installation

bower i uxland/s-html -S

License

Apache 2.0

About

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

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages