I need some assistance with utilizing $q in my Angular application while writing it in TypeScript. I've been facing difficulties and attempted to define a type definition file like so:
/// <reference path="../q/Q.d.ts" />
/// <reference path="../angularjs/angular.d.ts" />
declare module breeze.core {
export function extendQ(rootScope: ng.IScope, q: Q.Promise<any>): any;
export function to$q(qPromise: Q.Promise<any>, success: any, fail: any): any;
}
The behavior of the JavaScript code is resembling that of a c# extension method, but I am unsure how to achieve a similar effect using TypeScript. Please note that my experience with JavaScript is minimal and working with Breeze is new territory for me.