Directive to bind and compile an Html fragment.
3 people use it


ng-html-compile is a simple directive for Angualr JS to bind and compile an Html fragment.

Getting started

In your index.html:

In your script.js:

Child scope

If you use ng-html-compile inside a directive that create a child scope (like ng-repeat), be carrefull to use an object to define your model. Otherwise the binding will be created with a new property created inside the child scope.

index.html ```html


script.js ```javascript var myApp = angular.module('MyApp', ['ngHtmlCompile']);

function HomeCtrl($scope) { $ = { name: 'Camaron de la Isla' }; $scope.htmlTemplates = ['Name ']; }; ```

comments powered by Disqus
This page was last updated about 5 years ago.