title: AngularJS showing value based on id
body: <p>How can I change data based on id that is passed from json file.
  JSON:</p>
  
  <pre><code>{
    "hotels": [
    {
       "id" : 1,
       "name": "some hotel 1",
       "category" : [{
          "id" : 1,
          "hotel_id" : 1,
           "name"  : "Cat name 1",
           "bnb" : "yes",
           "simple" : "yes"
       }]
    },
     {
       "id" : 2,
       "name": "some hotel 2",
       "category" : [{
          "id" : 1,
          "hotel_id" : 2,
           "name"  : "Cat name 1",
           "bnb" : "yes",
           "simple" : "yes"
       }]
    }
    ]
  }
  </code></pre>
  
  <p>in my html I have ng-repeat like:</p>
  
  <pre><code>&lt;p&gt;Hotel names&lt;/p&gt;
      &lt;ul&gt;
          &lt;li ng-repeat="hotel in list.hotels"&gt;
  
              {{hotel.name}}
  
              &lt;ul class="thumbnails"&gt;
                  &lt;p&gt;Category&lt;/p&gt;
                  &lt;li ng-repeat="cat in hotel.category"&gt;
                      {{cat.name}}
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  </code></pre>
  
  <p>So this will show all what I have in that json file and I'm trying to limit it to show only data for one hotel (I know that I can do it with something like <code>{{hotel[0].name}}</code>) but there must be better approach, and also how can I use some kind of a switch by pressing the button to show data from hotel with id 1 to hotel with id 2 in the same div and vice versa?</p>
  
  <p>Thank you.</p>