I built web service with php that reads a database and echo json. I go to the path to see the result and the result is success. Here an example of my web service.
[{"id":"1","skill":"1","src":"walmart","total":"1"},{"id":"1","skill":"1","src":"target","total":"2"}]
Here is my app.js code
(function () {
'use strict';
var app = angular.module('myApp', ['angular.filter']);
// Declare app level module which depends on views, and components
app.controller('DeveloperTable', function ($scope, $http) {
var vm = this;
// GET request example:
$http({
method: 'GET',
url: '../_includes/web_service_person.php'
}).then(function successCallback(data) {
vm.developer = data;
}, function errorCallback(data) {
console.log(":(");
});
});
})();
Here is my index.html
<div ng-controller="DeveloperTable">
<h4>Developer Assesment</h4>
<table class="table">
<tr>
<th>pid</th>
<th ng-repeat="(skill, value) in developer | groupBy: 'skill'">
{{skill}}
</th>
</tr>
The funny part is that I don't have errors in my console, but I'm not getting data either. What I'm missing here?
Edit: The groupBy filter comes from the angular-filter library
ng-controller="DeveloperTable as vm"and then iteratevm.developer