This repo contains a bower package that provides an angular directive which can be passed trusted html with angular template content to evaluate.
The bind-html-compile
directive allows for HTML containing directives to be compiled.
You should only use this directive where the content is coming from a trusted source.
Install via bower
bower install angular-bind-html-compile
Add dependency to your app module
'angular-bind-html-compile'
Just like the standard ng-bind-html
, bind-html-compile
goes like this:
<div bind-html-compile="data.content"></div>
(However, unlike the standard ng-bind-html
, bind-html-compile
compiles directives!)
template-url
attribute can be used to load a template file:
<div bind-html-compile template-url="data.templateUrl"></div>
or a static path:
<div bind-html-compile template-url="'partials/myTemplate.html'"></div>
Also both attributes can be used together for loading a "piece of html code" as well as a "template file":
<div bind-html-compile="data.content" template-url="data.templateUrl"></div>
- Contributions welcome - Create an issue to discuss proposed changes and additions
- All contributions should be done in branches and submitted as pull requests.
- Code style follows the jsHint and jscs rules in
.jshintrc
andjscsrc
. Automated travis tests will fail if these are not adhered to.
- Commit your changes.
- Follow the guidelines at http://semver.org/ to determine your new version number.
- Update
CHANGELOG.md
with your new version number and a description of changes. - Update the
version
property inbower.json
andpackage.json
- Commit those changes with the commit message "Bump to [version number]". [version number] should be in the format x.y.z.
git tag [version number]
git push
git push --tags
- must be done separately.