dynamic-bind-html
A directive inspired by ng-bind-html
that accepts uncompiled angular code in addition to raw html.
You can also manually trigger a re-$compile
of its contents with an "updateDynamicBindHtml"
event.
Installation
Install via npm:
npm install dynamic-bind-html
Then include the dependency on your Angular module.
var app = angular;
Usage
In the template:
In the controller:
$scopedynamicHtml = "<span ng-bind-html='html'></span>";$scopehtml = "<h1>Expected Content</h1>";
Compiled result:
Expected Content
Development
Install Gulp via npm if you don't have it
npm install -g gulp
Install npm and bower dev dependencies
npm installbower install
Available commands
gulp
: build and test the project; equivalent togulp test
gulp build
: build the project and make new files indist
gulp serve
: start a server to serve the demo page and launch a browser then watches for changes insrc
files to reload the pagegulp test
: runs testsgulp serve-test
: runs tests and keep test browser open for development. Watches for changes in source and test files to re-run the tests
License
MIT