How to get $http response and assign to local variable using services?

Viewed 573

service.js

     angular.module('app')
        .service('tableService', [
        '$q',
      tableService
  ]);

  function tableService($q){
    var tableData = [
      {
        issue: 'Vinayak N',
        progress: 100,
       // status: 69,
        class: 'md-accent'
      }
    ];
}

i want to make a call to $http.get('http://localhost:5000/api/studentsList'); and assign the response.data to a local variable tableData in service.js

3 Answers
Related