ng-html-compile

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

NgHtmlCompile

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) { $scope.author = { name: 'Camaron de la Isla' }; $scope.htmlTemplates = ['Name ']; }; ```

comments powered by Disqus
This page was last updated almost 4 years ago.