i create one PHP web API,where i get response from API ok, but result not 
display on view

following is response which i get from Web API

Hide   Copy Code

{
            "status": true,
            "data": {
                "statistics": [
                    {
                        "State": "Karnataka",
                        "SurveyorName": "Keval Kakdiya",
                        "NoOfInt": "2",
                        "SampleReceived": "2",
                        "CancelledEntries": "0",
                        "Approved": "1",
                        "DisApproved": "1"
                    },
                    {
                        "State": "MAHARASHTRA",
                        "SurveyorName": "Keval Kakdiya",
                        "NoOfInt": "0",
                        "SampleReceived": "0",
                        "CancelledEntries": "1",
                        "Approved": "0",
                        "DisApproved": "0"
                    }
                ],
            }
        }



in angular i create one array and pass above response to that array

// following is angular code

Hide   Copy Code

result:any =[];



Hide   Copy Code

this.result = response;



// following is html code

Hide   Copy Code

<tr *ngFor="let report of result.data.statistics;">
                         <td> {{report.SurveyorName}}            </td>
                         <td> {{report.NoOfInt}}    </td>
                         <td> {{report.CancelledEntries}}    </td>
                         <td> {{report.Approved}}    </td>
                         <td> {{report.DisApproved}} </td>
                         <td> {{report.State}}</td>
                         <td> <button class="btn-dark" type='button'> View 
</button></td>
                      </tr>


-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/bbf3b912-4966-4a72-b08f-efc5b889e1bc%40googlegroups.com.

Reply via email to