Api-Service and HTTP-Service in Angular 2
<p>Im fairly new to Angular 2 and i have got a question.
In my "older" Angular 1 Webapps i had a "Api-Service" and a "Http-Service" every time.
They looked like this: 
"ApiService":</p>

<pre><code>    angular.module('ionicApp.apiServices', [])

    .service('apiService', function(httpService) {
        return {
            getProfile: function(){
                return httpService.async('get', 'profile', {}, {}, {});
            },
            addSkills: function(skillList) {
                var url = 'profile/skills';
                return httpService.async('post', url, {}, {}, skillList);
            }
}
</code></pre>

<p>HTTP-Service:</p>

<pre><code>angular.module('ionicApp.httpService', [])

.service('httpService', function ($http, $rootScope, $state, $ionicLoading, $ionicHistory) {
var httpCall = {
        async : function (method, url, header, params, data) {
            // Setze den X-AUTH-TOKEN in den Header, welcher für die Authentifizierung des Users verantwortlich ist
            if (url != 'login' || url != 'user/registerApp' || url != 'view/cities' || url != 'view/occupationals' || url != 'view/industries') {
                header['X-AUTH-TOKEN'] = $rootScope.userToken;
            }
            header['Access-Control-Allow-Origin'] = '*';
            // $http returns a promise, which has a then function, which also returns a promise
            var promise = $http({
                    method : method,
                    url : ipurl + url,
                    headers : header,
                    params : params,
                    data : data,
                    timeout: 10000,
                    withCredentials : true
                }).then(function successCallback(response) {
                    if (url != 'user/registerApp' || url != 'view/cities' || url != 'view/occupationals' || url != 'view/industries') {
                        $rootScope.userToken = response.headers('X-AUTH-TOKEN');
                    }
                    return response;
                }, function errorCallback(response) {
                    if (response.status === 401) {
                        $rootScope.isFailure = true;
                        $rootScope.failure = "Sie haben keine gültige Session mehr. Bitte loggen Sie sich erneut ein.";
                        doLogout();
                    } else {
                        return response;
                    }
                });
            // Return the promise to the controller
            return promise;
        },
        doLogout : doLogout

    };
    return httpCall;
});
</code></pre>

<p>Ok, now my question is, how can i do this with angular 2?
I already did an Api-Service and an HTTP-Service (both are Injectables), and injected them in each component.
But what´s the trick to get them functional?</p>

<p>Thanks so much!</p>