How can I add angularjs service in controller in typescript
<p>I have search on a lot of websites about adding service into controller in typescript. I have alose tried some example s from dfiffert websites and form stack overflow as well but I am still struggling. Will you please have a look on my code that what is the problem inside. </p>

<pre><code>module Application.Stores {

    export class StoreApplication {
        private sPresets: IStorePresets;

        constructor(presets: IStorePresets) {
            this.sPresets = presets;
        }

        init() {

            var newStoresApp = angular.module('NewStoresApp', []);
            this.dependency(newStoresApp);

            newStoresApp.service('StoreCollectionService', ['$http', '$q', 'sPresets', ($http, $q, sPresets) =&gt; new Application.Stores.Services.StoreCollectionService($http, $q, sPresets)]);
            // Working but without service 
            //newStoresApp.controller("CollectionCtrl", ['$scope', ($scope) =&gt; new Application.Stores.CollectionCtrl($scope)]);

            // Not working
            //newStoresApp.controller('CollectionCtrl', ['$scope', 'StoreCollectionService', Application.Stores.CollectionCtrl]);

            //Not Working
            //newStoresApp.controller("CollectionCtrl", ['$scope', 'StoreCollectionService', ($scope, StoreCollectionService) =&gt; new Application.Stores.CollectionCtrl($scope, StoreCollectionService)]);


            newStoresApp.controller("CollectionCtrl", []); // How can I do it here?
        }

        private dependency(app: ng.IModule) {
            app.factory("presets", () =&gt; {
                return this.sPresets;
            });
        }
    }
}
</code></pre>

<p>How can I add service into controller in this scanrio? </p>

<p>I have following order of included js files:</p>

<pre><code>Html.RequiresJs("https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js");
    Html.RequiresJs("~/Areas/Warehouse/Scripts/Stores/StoreCollectionService.js");
    Html.RequiresJs("~/Areas/Warehouse/Scripts/Stores/StoreCollectionsCtrl.js");
    Html.RequiresJs("~/Areas/Warehouse/Scripts/Stores/StoresApp.js");
</code></pre>

<p>And Code inside controller is as following:</p>

<pre><code>module Application.Stores {
        import Services = Application.Stores.StoreCollectionService;

        export class CollectionCtrl {

            private $scope: any;
            private storeCollectionService: StoreCollectionService;

            constructor($scope: ng.IScope, storeCollectionService: StoreCollectionService) {
                this.$scope = $scope;

                this.init();
            }

            init(): void {

            }


            private GetAll() {
                console.log("Got it all works.");
            }
        }
    }
</code></pre>

<p>I have I alos tried this example $inject['service']. For example you can view these helping links to support me in the question.</p>

<p><a href="https://stackoverflow.com/questions/19447886/how-can-i-define-an-angularjs-service-using-a-typescript-class-that-doesnt-poll">How can I define an AngularJS service using a TypeScript class that doesn&#39;t pollute the global scope?</a></p>

<p><a href="https://docs.angularjs.org/guide/di" rel="nofollow noreferrer">https://docs.angularjs.org/guide/di</a></p>