title: Get data in sucess(Ajax) from URL in JavaScript angular js
body: <p>I am using angular mobile Ui frame work. I am getting data from URL in controller. But right now i want to get particular data in success part. I will show my code snippet for hints.</p>
  
  <p>HTML:</p>
  
  <pre><code>   &lt;div class="jumbtron scrollable-content text-center bg-color"&gt;
     &lt;div class="row"&gt;
            &lt;div class="bgImage"&gt;  
            &lt;/div&gt;
            &lt;div class="btn-group img-responsive"  ng-controller="MyControllerCity"&gt; 
                &lt;div ng-repeat="prdct in cityProduct"&gt;
                     &lt;a href="#/category-prduct" style="color:#763428; font-weight:bold;"&gt;
                        &lt;img  src="{{prdct.categoryImage}}"&gt;
                      &lt;/a&gt;
                &lt;/div&gt;
            &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>HTML OUTPUT <br>
  <a href="https://i.stack.imgur.com/NliJM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NliJM.png" alt="enter image description here"></a></p>
  
  <p>Controller:</p>
  
  <pre><code>.controller('MyControllerCity',function($scope, $http){ 
          $http({
                  method:'get',
                  url:'http://192.168.0.3/sf/app/city-home/1',
                  headers: {'Content-Type': 'application/json'},
              }).success(function(data, status,headers, config) {
                  $scope.cityProduct = data; 
                  console.log("aaaaaaa" + cityProduct.categoryId);
  
              }).error(function(data, status, headers ,config) {
  
          })
  
  })
  </code></pre>
  
  <blockquote>
    <p>console.log("aaaaaaa" + cityProduct.categoryId);</p>
  </blockquote>
  
  <p>But categoryId not show in console.</p>
  
  <p>JSON Screen shot:
  <a href="https://i.stack.imgur.com/9ODoG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9ODoG.png" alt="enter image description here"></a>                 </p>
  
  <p>Here is the JSON response:</p>
  
  <pre><code>[{
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/cake.jpg",
      "categoryName": "cakes",
      "categoryId": 4
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/flowers.jpg",
      "categoryName": "flowers-and-bouquets",
      "categoryId": 12
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/chocolates.jpg",
      "categoryName": "chocolates-for-all",
      "categoryId": 63
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/mugs.jpg",
      "categoryName": "Mugs",
      "categoryId": 34
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/figurines.jpg",
      "categoryName": "figurines",
      "categoryId": 84
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/giftframes.jpg",
      "categoryName": "gift-and-photo-frames",
      "categoryId": 106
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/greetingcards.jpg",
      "categoryName": "greeting-cards",
      "categoryId": 103
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/handicrafts.jpg",
      "categoryName": "handicrafts",
      "categoryId": 44
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/penstands.jpg",
      "categoryName": "pen-stands",
      "categoryId": 142
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/combos.jpg",
      "categoryName": "gift-combos",
      "categoryId": 99
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/softtoys.jpg",
      "categoryName": "soft-toys",
      "categoryId": 104
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/diecasttoys.jpg",
      "categoryName": "diecast-toys",
      "categoryId": 138
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/jewellery.jpg",
      "categoryName": "jewellery",
      "categoryId": 41
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/clocks.jpg",
      "categoryName": "clocks",
      "categoryId": 137
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/crystalgifts.jpg",
      "categoryName": "crystal gifts",
      "categoryId": 136
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/lamps.jpg",
      "categoryName": "lamps",
      "categoryId": 97
  }, {
      "categoryImage": "https://www.winni.in/assets/img/app/city-home/slambook.jpg",
      "categoryName": "slambook",
      "categoryId": 139
  }]
  </code></pre>
  
  <p>I want to get categoryId in console.</p>
  
  <p>I used: </p>
  
  <blockquote>
    <p>console.log("categoryId  "+cityProduct[0].categoryId);</p>
  </blockquote>
  
  <p>But some error came, I will show you screen shot of console error:
  <a href="https://i.stack.imgur.com/6vyIG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6vyIG.png" alt="enter image description here"></a></p>
  
  <p>thanks in advance.</p>