How do you evaluate expressions that are strings in an object that you pass to a directive? I've looked at the following answers, but can't get this to work:
Compiling dynamic HTML strings from database
Dynamically add directive in AngularJS
How to get evaluated attributes inside a custom directive
Cutting to the chase, here is the code:
http://plnkr.co/edit/b2FblYElVGnzZRri34e0?p=preview
It's the {{units}} in the reportData object that I'm trying to evaluate. I've tried using the $compile service, but can't get it work. Thanks in advance!
.js:
var App = angular.module('plunker', [])
.controller("testCtrl", function($scope){
    $scope.units = "Houses";
    mockreport = {"COLUMNS":["People","Units"],"DATA":[[101,"{{units}}"],[100,"test 2"]]};
    $scope.reportData = mockreport;
})
.directive('testdirective', function($compile,$parse,$interpolate){
    return{
      restrict : 'E',
      scope:{  
        units:'@',
        reportData:'='
      },
      templateUrl:'table.html',
      link: function (scope, $el, attrs) {
        curHtml = $el.html();
      recompiledHtml = $compile(curHtml)(scope);
      //$el.html('');
      //$el.append(recompiledHtml);
    }
    };
});
index.html:
 <div data-ng-controller="testCtrl">
   <div class="panel panel-default">
      <testdirective report-data="reportData" units="{{units}}">
      </testdirective>
   </div>
</div>
table.html:
<h4>units: {{units}}</h4>
<table>
  <thead>
     <tr>
        <th data-ng-repeat="header in reportData.COLUMNS" data-ng-class="header">{{header}}</th>
     </tr>
  </thead>
  <tbody>
     <tr data-ng-repeat="column in reportData.DATA">
        <td data-ng-repeat="val in column">{{val}}</td>
     </tr>
  </tbody>
</table>
 
     
    