Best way to ng-repeat information inside of a <pre> tag

Viewed 1276

I would like to use angular's ngRepeat or similar to create some formatted text inside a "pre" block. For example, something like this:

function MyController($scope)
{
   $scope.data = [{test:'one', children:[...]},{test:'two', children:[...]}]; 
}

<pre>
  {{ngRepeat item in data}}
  {{item.test}}
       {{ngRepeat child in item.children}}
           {{child.title}}
       {{/ngRepeat}}
  {{/ngRepeat}}
</pre>

Obviously, I could just build up the string, but I'm curious if there is a way to do this in Angular templates.

1 Answers
Related