diff --git a/app/modules/main/directives/helpers/mdtAddHtmlContentToCellDirective.js b/app/modules/main/directives/helpers/mdtAddHtmlContentToCellDirective.js index e975691..bd13261 100644 --- a/app/modules/main/directives/helpers/mdtAddHtmlContentToCellDirective.js +++ b/app/modules/main/directives/helpers/mdtAddHtmlContentToCellDirective.js @@ -1,7 +1,7 @@ (function(){ 'use strict'; - function mdtAddHtmlContentToCellDirective($parse, $compile){ + function mdtAddHtmlContentToCellDirective($parse, $compile, $rootScope){ return { restrict: 'A', require: '^mdtTable', @@ -22,14 +22,15 @@ var customCellData = ctrl.tableDataStorageService.customCells[originalValue.columnKey]; var clonedHtml = customCellData.htmlContent; - var localScope = customCellData.scope; //append value to the scope + var localScope = $rootScope.$new(); localScope.value = val; $compile(clonedHtml)(localScope, function(cloned){ element.append(cloned); }); + }else{ element.append(val); } diff --git a/app/modules/main/directives/helpers/mdtCustomCellDirective.js b/app/modules/main/directives/helpers/mdtCustomCellDirective.js index e977907..b4aae19 100644 --- a/app/modules/main/directives/helpers/mdtCustomCellDirective.js +++ b/app/modules/main/directives/helpers/mdtCustomCellDirective.js @@ -12,10 +12,7 @@ transclude(function (clone) { var columnKey = attrs.columnKey; - // since user can have custom bindings inside the transcluded content, we have to store - // scope as well, to be able to compile the html content with the right scope context ctrl.tableDataStorageService.customCells[columnKey] = { - scope: $scope.$parent.$parent, htmlContent: clone.clone() }; }); diff --git a/bower.json b/bower.json index 21b90ab..ac18a2e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "md-data-table", - "version": "1.6.7", + "version": "1.6.8", "homepage": "https://github.com/iamisti/mdDataTable", "author":"Istvan Fodor ", "main": [ diff --git a/dist/md-data-table.js b/dist/md-data-table.js index b76666b..80ec01b 100644 --- a/dist/md-data-table.js +++ b/dist/md-data-table.js @@ -1216,8 +1216,8 @@ (function(){ 'use strict'; - mdtAddHtmlContentToCellDirective.$inject = ['$parse', '$compile']; - function mdtAddHtmlContentToCellDirective($parse, $compile){ + mdtAddHtmlContentToCellDirective.$inject = ['$parse', '$compile', '$rootScope']; + function mdtAddHtmlContentToCellDirective($parse, $compile, $rootScope){ return { restrict: 'A', require: '^mdtTable', @@ -1238,14 +1238,15 @@ var customCellData = ctrl.tableDataStorageService.customCells[originalValue.columnKey]; var clonedHtml = customCellData.htmlContent; - var localScope = customCellData.scope; //append value to the scope + var localScope = $rootScope.$new(); localScope.value = val; $compile(clonedHtml)(localScope, function(cloned){ element.append(cloned); }); + }else{ element.append(val); } @@ -1293,10 +1294,7 @@ transclude(function (clone) { var columnKey = attrs.columnKey; - // since user can have custom bindings inside the transcluded content, we have to store - // scope as well, to be able to compile the html content with the right scope context ctrl.tableDataStorageService.customCells[columnKey] = { - scope: $scope.$parent.$parent, htmlContent: clone.clone() }; }); diff --git a/package.json b/package.json index 362dfc0..328dfac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "md-data-table", - "version": "1.6.7", + "version": "1.6.8", "author": "Istvan Fodor ", "registry": "github", "repository": {