Question: Still trying to learn Angular

I have a plunker here <https://plnkr.co/edit/3FLmBtHP5TuOwWZHBMLK?p=preview>

I'm just trying to create an example of a directive with isolate scope.

I'm using $http and a promise to get some dummy json with car details.

I'm trying to display the car details in a directive.

The directive has an isolate scope and I'm trying to pass in 'car'.

I'm using ng-repeat to loop over the json but it's only diaplaying the directive once.

I'm getting a console error saying 'car' is not defined.

```js
(function() {

  angular
    .module('cxoJsApp')
    .directive('simple', function() {

      return {
        restrict: 'E',
        controller: 'simpleController',
        controllerAs: 'simpleCtrl',
        scope: {
          car: '='
        },
        bindtoController: true,
        templateUrl: 'simple.html'

      };

    });

})();

```

Answer: 
> 
> So, do you have any ideas how I can use a loop in that code?
> 
> 
> 

You put all your similar variables into a container (array or `List<>` might be the easiest) and then loop over them. 

As a general programming hint: when you notice yourself giving numbers to variables, stop and use a container.
```
var ints = new Dictionary<TextBox, int>();
foreach(var tb in new[] {
       a1Box, a2Box, a3Box, a4Box, a5Box, ... , anBox})
   ints.Add(tb, determinantes.aEntero(tb.Text));

```

to get the integer value for any box, 

```
var x = ints[a1Box];

```

but even better, just do it dynamically... create an extension on TextBox.

```
 public int IntegerValue(TextBox this tb)
 { return determinantes.aEntero(tb.Text)); }

```

then, anywhere in your code you can just get the integer value by writing `a1Box.IntegerValue()`

```
  var x = a1Box.IntegerValue();

```