Formatting is the job of a filter, not directive. Try:
<div ng-controller="Ctrl">
<div ng-repeat="line in lines">
<div ng-repeat="action in actions">{{line | format:action.content }}</div> //Change this line to use filter to format output
</div>
</div>
<script>
angular.module('docsSimpleDirective', [])
.controller('Ctrl', function($scope) {
$scope.lines = [
['11', '12', '13'],
['21', '22', '23'],
['31', '32', '33']
];
$scope.actions = [{
content: '{0}'
}, {
content: '{2}'
}];
})
.filter('format', function() { //Create a filter
return function(line,content) {
return content.replace(/\{\d+\}/g, function(number) {
return line[number.slice(1, -1)];
});
//scope.action.content = 1;
};
});
</script>