Services with ES6 (AngularJS) Services with ES6 (AngularJS) angularjs angularjs

Services with ES6 (AngularJS)


You need to use this.$http inside your getResults method.

(() => {  'use strict';      class ResultsFinder {	    static $inject = ['$http'];       constructor($http) {        this.$http = $http;    }		    getResults() {        return this.$http.get('/foo/bar/');    }}  /**   * @ngdoc service   * @name itemManager.service:ResultsFinder   *   * @description   *   */  angular    .module('itemManager')    .service('ResultsFinder', ResultsFinder);}());