angularjs-html-provider
Compile html on the fly inside your components using template literals. Useful if you want to write components that render other components with arbitrary templates, such as tables with interactive widgets.
Usage
Inject $scope
and the $html
provider in a component.
Calling $http
with $scope
as it's only argument will return a tag function.
var html ={return html``}
Example
my-button.component.js
MyButtonCtrl$inject = '$element' moduleexports = controller: MyButtonCtrl bindings: view: '<' { this { var world = 'world' var el = this $element }}
page.template.html
page.component.js:
Ctrl$inject = '$scope' '$html' moduleexports = controller: PageCtrl templateUrl: '/page.template.html' { var html = this { } this { return html` click me! ` }}
Installation
npm install angularjs-html-provider