Skip to content

Instantly share code, notes, and snippets.

@montyr75
Created December 6, 2014 20:00
Show Gist options
  • Save montyr75/2078bdc941d22ab0d131 to your computer and use it in GitHub Desktop.
Save montyr75/2078bdc941d22ab0d131 to your computer and use it in GitHub Desktop.
Dynamically create an HTML element from a String in Dart.
new Element.html("YOUR HTML STRING HERE");
// You may need to pass a NodeValidator to get everything to render, like:
NodeValidator nodeValidator = new NodeValidatorBuilder()
..allowTextElements();
// ..allowHtml5()
// ..allowElement('Button', attributes: ['ng-disabled']);
new Element.html("YOUR HTML STRING HERE", validator: nodeValidator);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment