This repository was archived by the owner on Feb 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-25
lines changed
src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Js Expand file tree Collapse file tree 1 file changed +13
-25
lines changed Original file line number Diff line number Diff line change 1
- angular . module ( "umbraco.directives" ) . directive ( "dtgeBindHtmlCompile" , [
2
-
3
- "$compile" ,
4
-
5
- function ( $compile ) {
6
-
7
- var directive = {
8
- restrict : "A" ,
9
- scope : {
10
- dtgeBindHtmlCompile : "="
11
- } ,
12
- link : function ( $scope , $element , $attrs ) {
13
- $scope . $watch ( function ( ) { return $scope . dtgeBindHtmlCompile } , function ( newValue , oldValue ) {
14
- $element . html ( newValue ) ;
15
-
16
- // Only compile child nodes to avoid starting an infinite loop
17
- var childNodes = $element . contents ( ) ;
18
- $compile ( childNodes ) ( $scope ) ;
19
- } ) ;
20
- }
21
- } ;
22
-
23
- return directive ;
24
- }
25
- ] ) ;
1
+ angular . module ( "umbraco.directives" ) . directive ( "dtgeBindHtmlCompile" , [ "$compile" , function ( $compile ) {
2
+ return {
3
+ restrict : "A" ,
4
+ link : function ( scope , element , attrs ) {
5
+ scope . $watch ( function ( ) {
6
+ return scope . $eval ( attrs . dtgeBindHtmlCompile ) ;
7
+ } , function ( value ) {
8
+ element . html ( value ) ;
9
+ $compile ( element . contents ( ) ) ( scope ) ;
10
+ } ) ;
11
+ }
12
+ } ;
13
+ } ] ) ;
You can’t perform that action at this time.
0 commit comments