Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Interesting to read through your AngularJS articles, especially for new learner.

Currently I am working on a project which has a senario to select parent list control to populate another dropdown list PLUS whenever list1 selected a child table data need to be refreshed and whenever list2 selected and again the table data need to be refreshed with respect to list1 and list2. I have done the list1 and list2 dependant population but unable to link these list boxes to a table with the given JSON data structure.

JSON DATA

{
    "STREAM_ID_1":{
    "stream":"STREAM ONE",
    "stream_level_all_tier_data":{
           "tier_id_1":{
          "Type":"Applications ONE",
          "Service":"Test Service ONE"
           },
           "tier_id_2":{
          "Type":"Applications TWO",
          "Service":"Test Service TWO"
           },
           "tier_id_3":{
          "Type":"Applications THREE",
          "Service":"Test Service THREE"
           }
        },
    "sectors":{
     "SECTOR_ID_1":{
        "sector":"Global Sector ONE",
        "sector_level_tier_data":{
           "tier_id_1":{
          "Type":"Applications ONE",
          "Service":"Test Service ONE"
           },
           "tier_id_2":{
          "Type":"Applications TWO",
          "Service":"Test Service TWO"
           }
        }
     },
     "SECTOR_ID_2":{
        "sector":"Global Sector TWO",
        "sector_level_tier_data":{
           "tier_id_3":{
          "Type":"Applications THREE",
          "Service":"Test Service THREE"
           }
        }
     }
    }
    }
}

CONTROLLER

.controller('nestedController', function ($scope, $http) {
    $http.get('json/jdata.json').success(function (data) {
        $scope.jdata = data;
    });

When List1 change occurs -- List2 get populated with dependant avlue -- Table data should show tier_id_1,tier_id_2 and tier_id_3 (Type, Service) values with respect to List1 value.

When List2 change occurs -- Table data should show tier_id_1,tier_id_2 or tier_id_3 (Type, Service) values based onc the sector selected from List2 value i.e. "Global Sector ONE" or "Global Sector TWO".

Appreciate if you could guide me what can be done to link the dropdown and the table by keeping the above data structure in mind.

Thanks in advance. Ravindra.

share|improve this question
    
please create a demo in plunker or jsfiddle.net. Also...I reformatted your code, but then you deleted the html and unformatted the json –  charlietfl Nov 20 '13 at 14:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.