Mohammed Gadiwala
Mohammed Gadiwala

Reputation: 2073

Why user ids not printing in angular js?

I followed the tutorial https://www.youtube.com/watch?v=iFsYJG3fGro#t=58.351349

I wrote this code:

  <!-- Meetups View -->
  <div ng-controller="mycontrl">
    <label for="singleSelect"> Select Date </label><br>
        <select nAMe="singleSelect" ng-model="dateSelect">
            <option value="2/01/2015">2nd Jan</option>
            <option value="3/01/2015">3rd Jan</option>

        </select><br>
         singleSelect = {{dateSelect}}
         <br/><br/><br/>


    <label for="singleSelect"> Select time </label><br>
        <select nAMe="singleSelect" ng-model="timeSelect">
             <option value="9/10">9AM-10AM</option>
            <option value="10/11">10AM-11AM</option>
            <option value="11/12">11AM-12PM</option>
            <option value="12/13">12PM-1PM</option>
            <option value="13/14">1PM-2PM</option>

         </select>
         <button ng-click="check()">Check!</button><br>
         singleSelect = {{timeSelect}}
         <br/><br/>
         {{vars}}
         {{vas}}<br/>
         <br/>
         {{therapist_list}}

         <ol ng-repeat="objects in therapist_list">
            **<li>{{object.userid}}</li>**
         </ol>
  </div>



  <script type="text/javascript" src="/js/application.js"></script>
  <script type="text/javascript" src="/js/controllers/controller2.js"></script>

The therapist_list is printed in json format but the list items are not printed for some reason. Given below is the outputOutput

Upvotes: 0

Views: 47

Answers (1)

valverde93
valverde93

Reputation: 1698

Your vars name aren't equals:

<ol ng-repeat="objects in therapist_list">
    **<li>{{object.userid}}</li>**
 </ol>

Replace objects from ng-repeat to object

Working JSFiddle example

Upvotes: 1

Related Questions