mardi 18 mai 2021

Why is ng-repeat being commented in devtools?

When I try to populate the options, nothing shows. In devtools, the ng-repeat seems to be commented out. See here:

ngRepeat: type in carCtrl.types

The option tag is not being recognised. I have tested my api's and they are working. Here is my HTML:

     <body ng-controller="CarController as carCtrl">
        <nav>
            <ul>
                <li>Welcome ....</li>
                <li><a href="index.html">Log Out</href></a></li>
                <li><a href="ownerHome.html">Home</href></a></li>

            </ul>
        </nav>
        
            <div class="innerContainer">

      <label> Search
   <input type="text" list="dataList">
      </label>
             <datalist id="dataList">
        <option ng-repeat="type in carCtrl.types" value=""> Type </option>
      </datalist>

            </div>

        <footer>
            <a href="#" class="fa fa-facebook"></a>
            <a href="#" class="fa fa-instagram"></a>
            <a href="#" class="fa fa-envelope"></a>

        </footer>

    </body> 

Here is my angularjs:

module.controller('CarController', function (registerCarAPI, $window, $sessionStorage, carAPI, carOwnerAPI, carTypeAPI, $scope) {
    this.listMessage = "Please register your car here:";
    this.types = carTypeAPI.query();
    this.cars = carAPI.query();


    this.ownerCars = carOwnerAPI.query({'ownerId': $sessionStorage.owner.OwnerID});


    this.registerCar = function (car) {


        car.ownerId = $sessionStorage.owner.OwnerID;
        registerCarAPI.save(null, car,
                function () {
                    $window.location = 'viewCars.html';
                },
                function (error) {
                    console.log(error);
                }

        );
    };


}); 



Aucun commentaire:

Enregistrer un commentaire