If you manually want to get / use Angular services in TypeScript you can use the following code:

 

/// <reference path="../libraries/angular/angular.d.ts" />

module app {
    "use strict";

    var appModule = angular.module("app", []);
    var injector: angular.auto.IInjectorService = angular.injector(["ng"]);
    var httpService: angular.IHttpService = injector.get("$http");
    var qService: angular.IQService = injector.get("$q");
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.