You were updating the value for categoryData.categorydetail with check box 
and over writing it with new value and there was no reference to its active 
parent 

Look at this function and debug what is happening

$scope.getsubCategory = function (categoryid) {
  $http.get("data"+categoryid+".json")
      .then(function(response) {
        $scope.subcategoryData = response.data;
        console.log($scope.subcategoryData)
      })
    };  


});


On Monday, June 6, 2016 at 5:13:29 PM UTC-4, Vijay Menon wrote:
>
> Kunal,
>
> Works like a charm!!! :) Thanks a lot . Could you please let me know what 
> i was doing wrong in the original one. Just started with Angular so would 
> like to understand. 
>
> Thanks,
> Vijay V Menon
>
> On Monday, June 6, 2016 at 3:31:14 PM UTC-5, Kunal Kamble wrote:
>>
>> Hi Vijay,
>>
>> Looks like you are looking for something like this.
>>
>> https://plnkr.co/edit/EAUlRZ6o8CQycQOgg135?p=preview
>>
>>
>>
>>
>>
>>
>> On Monday, June 6, 2016 at 2:27:13 PM UTC-4, Vijay Menon wrote:
>>>
>>> I have created a Plunker to demonstrate this: 
>>> https://plnkr.co/edit/LqioF8hugsjJCOfmj9Vb?p=preview
>>>
>>> If you see in the Plunk, If you check "Category 2" after checking 
>>> "Category 1", the subcategories get updated for both Category 1 and 2. Same 
>>> happpens for Category 3. The Subcategory for the last item is updated 
>>> everywhere. Please help me out on this and let me know what I am doing 
>>> wrong.
>>>
>>>
>>> Thanks,
>>>
>>> Vijay V Menon
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to