return {
template: '<ng-include src="getTemplateUrl()"/>',
scope: {
message: '=mainMessage',
typeMessage: '=typeMessage'
},
restrict: 'A',
controller: function($scope) {
$scope.getTemplateUrl = function() {
return 'template/common/' + $scope.typeMessage + "-message.tpl.html";
}
},
link: function(scope, element, attrs) {
}
}
<tr ng-repeat="item in mainData.items">
<td ng-repeat="prop in mainData.itemProps">{{item.prop}}</td>
</tr>