Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

This is my function to fetch the array.

  $scope.getclinicofuser = function()
    {
            var dataParameter =  {
                                    "primaryEmailId":$scope.data1.email                     
                                 }

                    $http({
                    url:  "/cms/api/user/getUserClinic",
                    method: "POST",
                    headers :{'Content-Type': 'application/json','Accept': 'application/json' },
                    data: dataParameter
                    }) .success(function(response) {

                    $scope.DomainName = response;
                 console.log($scope.DomainName);
                    });
    };

});

Here is the api call response

{
    "clinicNames": [2]
        0:  {
            "clinicName": "testing"
            "DomainName": "Aman.example.com"
            "primaryEmailId": "[email protected]"
        }-
        1:  {
            "clinicName": "test-clinic"
            "DomainName": "raman.example.com"
            "primaryEmailId": "[email protected]"
        }-
        -
        "status_code": "success"
}

My html tag

<li ng-repeat="response in DomainName">{{root.clinicNames}}</li>

Now what i want to do is to display BOTH DomainName in HTML i had a hussel with HTML ng-repeat tags but still no clues what i am doing wrong

share|improve this question
up vote 2 down vote accepted

Try

<li ng-repeat="response in DomainName.clinicNames track by $index">{{response.DomainName}}</li>
share|improve this answer
    
damn man it works...!! just tell me one thing... mujhe controller mai for each lagane ki jarurat kyu nai pari? isko ng-repeat se kaise handle kar lia? – adasdasd yesterday
    
bro ng-repeat will work same as each loop. Ye template me iterate karne ke kaam aata h. – Vineet yesterday
1  
thanks bhai... india ka naam ucha kar dia aaj tumne :D :D – adasdasd yesterday
    
thanks buddy :) – Vineet yesterday

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.