title: How would I get a list of years in my drop down list, without hard coding it, to display and function with my "Add" button?
body: <p>So I have figured out how to implement ng-repeat, but cannot figure out a way to loop through years  using getFullYear to display in the drop down properly without hard coding. Below is my current code (with hard coding), as well as the my old Javscript function.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var carsApp = angular.module('carsApp', []);
      
      carsApp.controller('carController', function ($scope) {
        $scope.cars = [];
        
        function hasDuplicates(newCar){
           var returnVal = false;
           angular.forEach($scope.cars, function(car, key){
              if (angular.equals(car, newCar))
              {
                returnVal = true;
              }
            });
           return returnVal;
        };
  
  
        $scope.add = function () {
            
            var newCar = {
              make: $scope.make,
              model: $scope.model,
              numDoors: $scope.numDoors,
              yearBuilt: $scope.yearBuilt
            };
       
            if (hasDuplicates(newCar)) {
  
                alert("Car already exists");
  
            } else {
             
                $scope.cars.push(newCar);
                $scope.make = null;
                $scope.model = null;
                $scope.numDoors = null;
                $scope.yearBuilt = null;
            }
            
        };      
  
  
        $scope.removeRow = function (deleteRow) {
           $scope.cars.splice(deleteRow, 1);
        };
  
        $scope.rowClick = function(car){
            $scope.make= car.make;
            $scope.model= car.model;
            $scope.numDoors= car.numDoors;
            $scope.yearBuilt= car.yearBuilt;
        };
  
        $scope.data = {
          model: null,
          availableYears: [
            {id: '1960'},
            {id: '1961'},
            {id: '1962'},
            {id: '1963'},
            {id: '1964'},
            {id: '1965'},
            {id: '1966'},
            {id: '1967'},
            {id: '1968'},
            {id: '1969'},
            {id: '1970'},
            {id: '1971'},
            {id: '1972'},
            {id: '1973'},
            {id: '1974'},
            {id: '1975'},
            {id: '1976'}
          ]
        };
            
      });
    &lt;/script&gt;
  &lt;/head&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
  &lt;html ng-app="carsApp"&gt;
  &lt;head&gt;
    &lt;title&gt;Angular Test&lt;/title&gt;
  
    &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" type="text/css" /&gt;
  
    &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
    &lt;script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"&gt;&lt;/script&gt;
  
    &lt;style&gt;
  
  
    &lt;/style&gt;
  
  &lt;body ng-controller="carController"&gt;
  &lt;form class="form-inline"&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="make"&gt;Make&lt;/label&gt;
      &lt;input type="text" class="form-control" id="make" placeholder="Make" ng-model="make"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="numDoors"&gt;Number of Doors&lt;/label&gt;
      &lt;input type="text" class="form-control" id="numDoors" placeholder="Number of Doors" ng-model="numDoors"&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  &lt;form class="form-inline"&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="model"&gt;Model&lt;/label&gt;
      &lt;input type="text" class="form-control" id="model" placeholder="Model" ng-model="model"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="yearBuilt"&gt;Year Built&lt;/label&gt;
      &lt;select name="dateYearBuilt" id="dateYearBuilt" ng-model="yearBuilt"&gt;
        &lt;option ng-repeat="years in data.availableYears" value="{{years.id}}"&gt;{{years.id}}&lt;/option&gt;
      &lt;/select&gt;
    &lt;/form&gt;
    &lt;button ng-click="add()" class="btn btn-primary"&gt;Add&lt;/button&gt;
  &lt;/div&gt;
  &lt;/form&gt;
    &lt;table class="table table-striped table-bordered"&gt;
          &lt;tr&gt;
              &lt;th&gt;Make&lt;/th&gt;
              &lt;th&gt;Model&lt;/th&gt;
              &lt;th&gt;Number of Doors&lt;/th&gt;
              &lt;th&gt;Year Built&lt;/th&gt;
              &lt;th&gt;Action&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr ng-repeat="car in cars" ng-click="rowClick(car)"&gt;
              &lt;td&gt;{{car.make}}&lt;/td&gt;
              &lt;td&gt;{{car.model}}&lt;/td&gt;
              &lt;td&gt;{{car.numDoors}}&lt;/td&gt;
              &lt;td&gt;{{car.yearBuilt}}&lt;/td&gt;
              &lt;td&gt;&lt;input type="button" value="Remove" class="btn btn-danger" data-ng-click="removeRow($index)"/&gt;&lt;/td&gt;
          &lt;/tr&gt;
    &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is my old function that worked when I was not using ng-repeat.</p>
  
  <pre><code> var max = new Date().getFullYear(),
      min = max - 57,
      max = max + 1,
      select = document.getElementById('dateYearBuilt');
  
    for (var i = min; i&lt;=max; i++){
      var opt = document.createElement('option');
      opt.value = i;
      opt.innerHTML = i;
      select.appendChild(opt);
    };
  </code></pre>
  
  <p>Thank you all.</p>